[libvirt] [PATCH 1/5] maint: don't mark VIR_WARN or VIR_WARN0 diagnostics for translation

From: Jim Meyering <meyering@redhat.com> Approximately 60 messages were marked. Since these diagnostics are intended solely for developers and maintainers, encouraging translation is deemed to be counterproductive: http://thread.gmane.org/gmane.comp.emulators.libvirt/25050/focus=25052 Run this command: git grep -l VIR_WARN|xargs perl -pi -e \ 's/(VIR_WARN0?)\s*\(_\((".*?")\)/$1($2/' --- daemon/libvirtd.c | 6 +++--- src/lxc/lxc_container.c | 2 +- src/lxc/lxc_controller.c | 2 +- src/network/bridge_driver.c | 8 ++++---- src/qemu/qemu_conf.c | 12 ++++++------ src/qemu/qemu_driver.c | 32 ++++++++++++++++---------------- src/qemu/qemu_monitor_text.c | 22 +++++++++++----------- src/uml/uml_driver.c | 12 ++++++------ src/util/logging.c | 8 ++++---- src/util/pci.c | 8 ++++---- src/xen/proxy_internal.c | 6 +++--- 11 files changed, 59 insertions(+), 59 deletions(-) diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index 4533f40..cc05953 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -384,14 +384,14 @@ qemudDispatchSignalEvent(int watch ATTRIBUTE_UNUSED, virHookCall(VIR_HOOK_DRIVER_DAEMON, "-", VIR_HOOK_DAEMON_OP_RELOAD, SIGHUP, "SIGHUP", NULL); if (virStateReload() < 0) - VIR_WARN0(_("Error while reloading drivers")); + VIR_WARN0("Error while reloading drivers"); break; case SIGINT: case SIGQUIT: case SIGTERM: - VIR_WARN(_("Shutting down on signal %d"), siginfo.si_signo); + VIR_WARN("Shutting down on signal %d", siginfo.si_signo); server->quitEventThread = 1; break; @@ -2761,7 +2761,7 @@ remoteReadConfigFile (struct qemud_server *server, const char *filename) GET_CONF_STR (conf, filename, unix_sock_group); if (unix_sock_group) { if (!server->privileged) { - VIR_WARN0(_("Cannot set group when not running as root")); + VIR_WARN0("Cannot set group when not running as root"); } else { int ret; struct group grpdata, *grp; diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index 706c796..018f4d5 100644 --- a/src/lxc/lxc_container.c +++ b/src/lxc/lxc_container.c @@ -716,7 +716,7 @@ static int lxcContainerDropCapabilities(void) * be unmasked - they can never escape the bounding set. */ #else - VIR_WARN0(_("libcap-ng support not compiled in, unable to clear capabilities")); + VIR_WARN0("libcap-ng support not compiled in, unable to clear capabilities"); #endif return 0; } diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index c120b8e..1732780 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -259,7 +259,7 @@ static int lxcControllerClearCapabilities(void) return -1; } #else - VIR_WARN0(_("libcap-ng support not compiled in, unable to clear capabilities")); + VIR_WARN0("libcap-ng support not compiled in, unable to clear capabilities"); #endif return 0; } diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 8432bbc..3b9b4f4 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -995,14 +995,14 @@ static int networkStartNetworkDaemon(struct network_driver *driver, err_delbr1: if ((err = brSetInterfaceUp(driver->brctl, network->def->bridge, 0))) { char ebuf[1024]; - VIR_WARN(_("Failed to bring down bridge '%s' : %s"), + VIR_WARN("Failed to bring down bridge '%s' : %s", network->def->bridge, virStrerror(err, ebuf, sizeof ebuf)); } err_delbr: if ((err = brDeleteBridge(driver->brctl, network->def->bridge))) { char ebuf[1024]; - VIR_WARN(_("Failed to delete bridge '%s' : %s"), + VIR_WARN("Failed to delete bridge '%s' : %s", network->def->bridge, virStrerror(err, ebuf, sizeof ebuf)); } @@ -1035,12 +1035,12 @@ static int networkShutdownNetworkDaemon(struct network_driver *driver, char ebuf[1024]; if ((err = brSetInterfaceUp(driver->brctl, network->def->bridge, 0))) { - VIR_WARN(_("Failed to bring down bridge '%s' : %s"), + VIR_WARN("Failed to bring down bridge '%s' : %s", network->def->bridge, virStrerror(err, ebuf, sizeof ebuf)); } if ((err = brDeleteBridge(driver->brctl, network->def->bridge))) { - VIR_WARN(_("Failed to delete bridge '%s' : %s"), + VIR_WARN("Failed to delete bridge '%s' : %s", network->def->bridge, virStrerror(err, ebuf, sizeof ebuf)); } diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 5fa8c0a..3e334dc 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -523,7 +523,7 @@ rewait: * as there's really no need to throw an error if we did * actually read a valid version number above */ if (WEXITSTATUS(status) != 0) { - VIR_WARN(_("Unexpected exit status '%d', qemu probably failed"), + VIR_WARN("Unexpected exit status '%d', qemu probably failed", WEXITSTATUS(status)); } @@ -767,7 +767,7 @@ rewait: * as there's really no need to throw an error if we did * actually read a valid version number above */ if (WEXITSTATUS(status) != 0) { - VIR_WARN(_("Unexpected exit status '%d', qemu probably failed"), + VIR_WARN("Unexpected exit status '%d', qemu probably failed", WEXITSTATUS(status)); } @@ -847,7 +847,7 @@ qemudCapsInitGuest(virCapsPtr caps, binary_mtime = st.st_mtime; } else { char ebuf[1024]; - VIR_WARN(_("Failed to stat %s, most peculiar : %s"), + VIR_WARN("Failed to stat %s, most peculiar : %s", binary, virStrerror(errno, ebuf, sizeof(ebuf))); binary_mtime = 0; } @@ -932,7 +932,7 @@ qemudCapsInitGuest(virCapsPtr caps, binary_mtime = st.st_mtime; } else { char ebuf[1024]; - VIR_WARN(_("Failed to stat %s, most peculiar : %s"), + VIR_WARN("Failed to stat %s, most peculiar : %s", binary, virStrerror(errno, ebuf, sizeof(ebuf))); binary_mtime = 0; } @@ -1403,7 +1403,7 @@ rewait: * as there's really no need to throw an error if we did * actually read a valid version number above */ if (WEXITSTATUS(status) != 0) { - VIR_WARN(_("Unexpected exit status '%d', qemu probably failed"), + VIR_WARN("Unexpected exit status '%d', qemu probably failed", WEXITSTATUS(status)); } @@ -6147,7 +6147,7 @@ virDomainDefPtr qemuParseCommandLine(virCapsPtr caps, } else if (STREQ(arg, "-S")) { /* ignore, always added by libvirt */ } else { - VIR_WARN(_("unknown QEMU argument '%s' during conversion"), arg); + VIR_WARN("unknown QEMU argument '%s' during conversion", arg); #if 0 qemuReportError(VIR_ERR_INTERNAL_ERROR, _("unknown argument '%s'"), arg); diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 609fabe..c103592 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -689,12 +689,12 @@ qemudRemoveDomainStatus(struct qemud_driver *driver, } if (unlink(file) < 0 && errno != ENOENT && errno != ENOTDIR) - VIR_WARN(_("Failed to remove domain XML for %s: %s"), + VIR_WARN("Failed to remove domain XML for %s: %s", vm->def->name, virStrerror(errno, ebuf, sizeof(ebuf))); VIR_FREE(file); if (virFileDeletePid(driver->stateDir, vm->def->name) != 0) - VIR_WARN(_("Failed to remove PID file for %s: %s"), + VIR_WARN("Failed to remove PID file for %s: %s", vm->def->name, virStrerror(errno, ebuf, sizeof(ebuf))); @@ -2108,7 +2108,7 @@ cleanup: closelog: if (close(logfd) < 0) { char ebuf[4096]; - VIR_WARN(_("Unable to close logfile: %s"), + VIR_WARN("Unable to close logfile: %s", virStrerror(errno, ebuf, sizeof ebuf)); } @@ -3441,29 +3441,29 @@ static int qemudStartVMDaemon(virConnectPtr conn, tmp = progenv; while (*tmp) { if (safewrite(logfile, *tmp, strlen(*tmp)) < 0) - VIR_WARN(_("Unable to write envv to logfile: %s"), + VIR_WARN("Unable to write envv to logfile: %s", virStrerror(errno, ebuf, sizeof ebuf)); if (safewrite(logfile, " ", 1) < 0) - VIR_WARN(_("Unable to write envv to logfile: %s"), + VIR_WARN("Unable to write envv to logfile: %s", virStrerror(errno, ebuf, sizeof ebuf)); tmp++; } tmp = argv; while (*tmp) { if (safewrite(logfile, *tmp, strlen(*tmp)) < 0) - VIR_WARN(_("Unable to write argv to logfile: %s"), + VIR_WARN("Unable to write argv to logfile: %s", virStrerror(errno, ebuf, sizeof ebuf)); if (safewrite(logfile, " ", 1) < 0) - VIR_WARN(_("Unable to write argv to logfile: %s"), + VIR_WARN("Unable to write argv to logfile: %s", virStrerror(errno, ebuf, sizeof ebuf)); tmp++; } if (safewrite(logfile, "\n", 1) < 0) - VIR_WARN(_("Unable to write argv to logfile: %s"), + VIR_WARN("Unable to write argv to logfile: %s", virStrerror(errno, ebuf, sizeof ebuf)); if ((pos = lseek(logfile, 0, SEEK_END)) < 0) - VIR_WARN(_("Unable to seek to end of logfile: %s"), + VIR_WARN("Unable to seek to end of logfile: %s", virStrerror(errno, ebuf, sizeof ebuf)); for (i = 0 ; i < ntapfds ; i++) @@ -6944,7 +6944,7 @@ static int qemudDomainAttachPciDiskDevice(struct qemud_driver *driver, if (ret == 0) { ret = qemuMonitorAddDevice(priv->mon, devstr); if (ret < 0) { - VIR_WARN(_("qemuMonitorAddDevice failed on %s (%s)"), + VIR_WARN("qemuMonitorAddDevice failed on %s (%s)", drivestr, devstr); /* XXX should call 'drive_del' on error but this does not exist yet */ @@ -7174,7 +7174,7 @@ static int qemudDomainAttachSCSIDisk(struct qemud_driver *driver, if (ret == 0) { ret = qemuMonitorAddDevice(priv->mon, devstr); if (ret < 0) { - VIR_WARN(_("qemuMonitorAddDevice failed on %s (%s)"), + VIR_WARN("qemuMonitorAddDevice failed on %s (%s)", drivestr, devstr); /* XXX should call 'drive_del' on error but this does not exist yet */ @@ -7267,7 +7267,7 @@ static int qemudDomainAttachUsbMassstorageDevice(struct qemud_driver *driver, if (ret == 0) { ret = qemuMonitorAddDevice(priv->mon, devstr); if (ret < 0) { - VIR_WARN(_("qemuMonitorAddDevice failed on %s (%s)"), + VIR_WARN("qemuMonitorAddDevice failed on %s (%s)", drivestr, devstr); /* XXX should call 'drive_del' on error but this does not exist yet */ @@ -7491,12 +7491,12 @@ try_remove: goto no_memory; qemuDomainObjEnterMonitorWithDriver(driver, vm); if (qemuMonitorRemoveNetdev(priv->mon, netdev_name) < 0) - VIR_WARN(_("Failed to remove network backend for netdev %s"), + VIR_WARN("Failed to remove network backend for netdev %s", netdev_name); qemuDomainObjExitMonitorWithDriver(driver, vm); VIR_FREE(netdev_name); } else { - VIR_WARN0(_("Unable to remove network backend")); + VIR_WARN0("Unable to remove network backend"); } } else { char *hostnet_name; @@ -7504,7 +7504,7 @@ try_remove: goto no_memory; qemuDomainObjEnterMonitorWithDriver(driver, vm); if (qemuMonitorRemoveHostNetwork(priv->mon, vlan, hostnet_name) < 0) - VIR_WARN(_("Failed to remove network backend for vlan %d, net %s"), + VIR_WARN("Failed to remove network backend for vlan %d, net %s", vlan, hostnet_name); qemuDomainObjExitMonitorWithDriver(driver, vm); VIR_FREE(hostnet_name); @@ -7518,7 +7518,7 @@ try_tapfd_close: if (tapfd_name) { qemuDomainObjEnterMonitorWithDriver(driver, vm); if (qemuMonitorCloseFileHandle(priv->mon, tapfd_name) < 0) - VIR_WARN(_("Failed to close tapfd with '%s'"), tapfd_name); + VIR_WARN("Failed to close tapfd with '%s'", tapfd_name); qemuDomainObjExitMonitorWithDriver(driver, vm); } diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c index ec3d69d..3df078a 100644 --- a/src/qemu/qemu_monitor_text.c +++ b/src/qemu/qemu_monitor_text.c @@ -1445,42 +1445,42 @@ qemuMonitorTextParsePciAddReply(qemuMonitorPtr mon ATTRIBUTE_UNUSED, s += strlen("domain "); if (virStrToLong_ui(s, &e, 10, &addr->domain) == -1) { - VIR_WARN(_("Unable to parse domain number '%s'"), s); + VIR_WARN("Unable to parse domain number '%s'", s); return -1; } if (!STRPREFIX(e, ", ")) { - VIR_WARN(_("Expected ', ' parsing pci_add reply '%s'"), s); + VIR_WARN("Expected ', ' parsing pci_add reply '%s'", s); return -1; } s = e + 2; } if (!STRPREFIX(s, "bus ")) { - VIR_WARN(_("Expected 'bus ' parsing pci_add reply '%s'"), s); + VIR_WARN("Expected 'bus ' parsing pci_add reply '%s'", s); return -1; } s += strlen("bus "); if (virStrToLong_ui(s, &e, 10, &addr->bus) == -1) { - VIR_WARN(_("Unable to parse bus number '%s'"), s); + VIR_WARN("Unable to parse bus number '%s'", s); return -1; } if (!STRPREFIX(e, ", ")) { - VIR_WARN(_("Expected ', ' parsing pci_add reply '%s'"), s); + VIR_WARN("Expected ', ' parsing pci_add reply '%s'", s); return -1; } s = e + 2; if (!STRPREFIX(s, "slot ")) { - VIR_WARN(_("Expected 'slot ' parsing pci_add reply '%s'"), s); + VIR_WARN("Expected 'slot ' parsing pci_add reply '%s'", s); return -1; } s += strlen("slot "); if (virStrToLong_ui(s, &e, 10, &addr->slot) == -1) { - VIR_WARN(_("Unable to parse slot number '%s'"), s); + VIR_WARN("Unable to parse slot number '%s'", s); return -1; } @@ -2029,25 +2029,25 @@ qemudParseDriveAddReply(const char *reply, s += strlen("bus "); if (virStrToLong_ui(s, &e, 10, &addr->bus) == -1) { - VIR_WARN(_("Unable to parse bus '%s'"), s); + VIR_WARN("Unable to parse bus '%s'", s); return -1; } if (!STRPREFIX(e, ", ")) { - VIR_WARN(_("Expected ', ' parsing drive_add reply '%s'"), s); + VIR_WARN("Expected ', ' parsing drive_add reply '%s'", s); return -1; } s = e + 2; } if (!STRPREFIX(s, "unit ")) { - VIR_WARN(_("Expected 'unit ' parsing drive_add reply '%s'"), s); + VIR_WARN("Expected 'unit ' parsing drive_add reply '%s'", s); return -1; } s += strlen("bus "); if (virStrToLong_ui(s, &e, 10, &addr->unit) == -1) { - VIR_WARN(_("Unable to parse unit number '%s'"), s); + VIR_WARN("Unable to parse unit number '%s'", s); return -1; } diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c index ffb87c8..9a9cdc2 100644 --- a/src/uml/uml_driver.c +++ b/src/uml/uml_driver.c @@ -881,25 +881,25 @@ static int umlStartVMDaemon(virConnectPtr conn, tmp = progenv; while (*tmp) { if (safewrite(logfd, *tmp, strlen(*tmp)) < 0) - VIR_WARN(_("Unable to write envv to logfile: %s"), + VIR_WARN("Unable to write envv to logfile: %s", virStrerror(errno, ebuf, sizeof ebuf)); if (safewrite(logfd, " ", 1) < 0) - VIR_WARN(_("Unable to write envv to logfile: %s"), + VIR_WARN("Unable to write envv to logfile: %s", virStrerror(errno, ebuf, sizeof ebuf)); tmp++; } tmp = argv; while (*tmp) { if (safewrite(logfd, *tmp, strlen(*tmp)) < 0) - VIR_WARN(_("Unable to write argv to logfile: %s"), + VIR_WARN("Unable to write argv to logfile: %s", virStrerror(errno, ebuf, sizeof ebuf)); if (safewrite(logfd, " ", 1) < 0) - VIR_WARN(_("Unable to write argv to logfile: %s"), + VIR_WARN("Unable to write argv to logfile: %s", virStrerror(errno, ebuf, sizeof ebuf)); tmp++; } if (safewrite(logfd, "\n", 1) < 0) - VIR_WARN(_("Unable to write argv to logfile: %s"), + VIR_WARN("Unable to write argv to logfile: %s", virStrerror(errno, ebuf, sizeof ebuf)); priv->monitor = -1; @@ -947,7 +947,7 @@ static void umlShutdownVMDaemon(virConnectPtr conn ATTRIBUTE_UNUSED, priv->monitor = -1; if ((ret = waitpid(vm->pid, NULL, 0)) != vm->pid) { - VIR_WARN(_("Got unexpected pid %d != %d"), + VIR_WARN("Got unexpected pid %d != %d", ret, vm->pid); } diff --git a/src/util/logging.c b/src/util/logging.c index 6bc2ccf..248c47e 100644 --- a/src/util/logging.c +++ b/src/util/logging.c @@ -330,7 +330,7 @@ error: */ int virLogSetDefaultPriority(int priority) { if ((priority < VIR_LOG_DEBUG) || (priority > VIR_LOG_ERROR)) { - VIR_WARN0(_("Ignoring invalid log level setting.")); + VIR_WARN0("Ignoring invalid log level setting."); return(-1); } if (!virLogInitialized) @@ -781,7 +781,7 @@ int virLogParseOutputs(const char *outputs) { ret = count; cleanup: if (ret == -1) - VIR_WARN0(_("Ignoring invalid log output setting.")); + VIR_WARN0("Ignoring invalid log output setting."); return(ret); } @@ -837,7 +837,7 @@ int virLogParseFilters(const char *filters) { ret = count; cleanup: if (ret == -1) - VIR_WARN0(_("Ignoring invalid log filter setting.")); + VIR_WARN0("Ignoring invalid log filter setting."); return(ret); } @@ -959,7 +959,7 @@ int virLogParseDefaultPriority(const char *priority) { else if (STREQ(priority, "4") || STREQ(priority, "error")) ret = virLogSetDefaultPriority(VIR_LOG_ERROR); else - VIR_WARN0(_("Ignoring invalid log level setting")); + VIR_WARN0("Ignoring invalid log level setting"); return ret; } diff --git a/src/util/pci.c b/src/util/pci.c index a1bd8e3..b93f28c 100644 --- a/src/util/pci.c +++ b/src/util/pci.c @@ -173,7 +173,7 @@ pciOpenConfig(pciDevice *dev) fd = open(dev->path, O_RDWR); if (fd < 0) { char ebuf[1024]; - VIR_WARN(_("Failed to open config space file '%s': %s"), + VIR_WARN("Failed to open config space file '%s': %s", dev->path, virStrerror(errno, ebuf, sizeof(ebuf))); return -1; } @@ -193,7 +193,7 @@ pciRead(pciDevice *dev, unsigned pos, uint8_t *buf, unsigned buflen) if (lseek(dev->fd, pos, SEEK_SET) != pos || saferead(dev->fd, buf, buflen) != buflen) { char ebuf[1024]; - VIR_WARN(_("Failed to read from '%s' : %s"), dev->path, + VIR_WARN("Failed to read from '%s' : %s", dev->path, virStrerror(errno, ebuf, sizeof(ebuf))); return -1; } @@ -233,7 +233,7 @@ pciWrite(pciDevice *dev, unsigned pos, uint8_t *buf, unsigned buflen) if (lseek(dev->fd, pos, SEEK_SET) != pos || safewrite(dev->fd, buf, buflen) != buflen) { char ebuf[1024]; - VIR_WARN(_("Failed to write to '%s' : %s"), dev->path, + VIR_WARN("Failed to write to '%s' : %s", dev->path, virStrerror(errno, ebuf, sizeof(ebuf))); return -1; } @@ -730,7 +730,7 @@ recheck: if (virRun(backprobe, NULL) < 0 && virRun(stubprobe, NULL) < 0) { char ebuf[1024]; - VIR_WARN(_("failed to load pci-stub or pciback drivers: %s"), + VIR_WARN("failed to load pci-stub or pciback drivers: %s", virStrerror(errno, ebuf, sizeof ebuf)); return 0; } diff --git a/src/xen/proxy_internal.c b/src/xen/proxy_internal.c index 1efdb83..db209d1 100644 --- a/src/xen/proxy_internal.c +++ b/src/xen/proxy_internal.c @@ -240,7 +240,7 @@ virProxyCloseSocket(xenUnifiedPrivatePtr priv) { ret = close(priv->proxy); if (ret != 0) - VIR_WARN(_("Failed to close socket %d"), priv->proxy); + VIR_WARN("Failed to close socket %d", priv->proxy); else VIR_DEBUG("Closed socket %d", priv->proxy); priv->proxy = -1; @@ -297,7 +297,7 @@ virProxyWriteClientSocket(int fd, const char *data, int len) { ret = safewrite(fd, data, len); if (ret < 0) { - VIR_WARN(_("Failed to write to socket %d"), fd); + VIR_WARN("Failed to write to socket %d", fd); return(-1); } VIR_DEBUG("wrote %d bytes to socket %d", @@ -452,7 +452,7 @@ retry: goto error; } if (res->serial != serial) { - VIR_WARN(_("got asynchronous packet number %d"), res->serial); + VIR_WARN("got asynchronous packet number %d", res->serial); goto retry; } -- 1.7.1.259.g3aef8

From: Jim Meyering <meyering@redhat.com> * src/util/uuid.c (virUUIDGenerate): Remove _(...) manually. --- src/util/uuid.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/uuid.c b/src/util/uuid.c index 459273a..9c626ce 100644 --- a/src/util/uuid.c +++ b/src/util/uuid.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007, 2008, 2009 Red Hat, Inc. + * Copyright (C) 2007, 2008, 2009, 2010 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -101,8 +101,8 @@ virUUIDGenerate(unsigned char *uuid) if ((err = virUUIDGenerateRandomBytes(uuid, VIR_UUID_BUFLEN))) { char ebuf[1024]; - VIR_WARN(_("Falling back to pseudorandom UUID," - " failed to generate random bytes: %s"), + VIR_WARN("Falling back to pseudorandom UUID," + " failed to generate random bytes: %s", virStrerror(err, ebuf, sizeof ebuf)); err = virUUIDGeneratePseudoRandomBytes(uuid, VIR_UUID_BUFLEN); } -- 1.7.1.259.g3aef8

On Wed, May 19, 2010 at 04:47:17PM +0200, Jim Meyering wrote:
From: Jim Meyering <meyering@redhat.com>
* src/util/uuid.c (virUUIDGenerate): Remove _(...) manually. --- src/util/uuid.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
ACK Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

From: Jim Meyering <meyering@redhat.com> * cfg.mk (sc_prohibit_gettext_markup): New rule, to enforce this policy. Contrary to most diagnostic-emitting functions, where we require _(...) markup, here, we require that _() *not* be used for certain functions (or function-like macros). --- cfg.mk | 19 +++++++++++++------ 1 files changed, 13 insertions(+), 6 deletions(-) diff --git a/cfg.mk b/cfg.mk index 96d6953..04719d4 100644 --- a/cfg.mk +++ b/cfg.mk @@ -228,7 +228,7 @@ sc_avoid_write: @prohibit='\<write *\(' \ in_vc_files='\.c$$' \ halt='consider using safewrite instead of write' \ - $(_sc_search_regexp) + $(_sc_search_regexp) # Use STREQ rather than comparing strcmp == 0, or != 0. # Similarly, use STREQLEN or STRPREFIX rather than strncmp. @@ -285,7 +285,7 @@ sc_prohibit_nonreentrant: sc_prohibit_ctype_h: @prohibit='^# *include *<ctype\.h>' \ halt="don't use ctype.h; instead, use c-ctype.h" \ - $(_sc_search_regexp) + $(_sc_search_regexp) # Ensure that no C source file or rng schema uses TABs for # indentation. Also match *.h.in files, to get libvirt.h.in. Exclude @@ -294,7 +294,7 @@ sc_TAB_in_indentation: @prohibit='^ * ' \ in_vc_files='(\.(rng|[ch](\.in)?)|(daemon|tools)/.*\.in)$$' \ halt='use spaces, not TAB, for indentation in C, sh, and RNG schemas' \ - $(_sc_search_regexp) + $(_sc_search_regexp) ctype_re = isalnum|isalpha|isascii|isblank|iscntrl|isdigit|isgraph|islower\ |isprint|ispunct|isspace|isupper|isxdigit|tolower|toupper @@ -302,7 +302,7 @@ ctype_re = isalnum|isalpha|isascii|isblank|iscntrl|isdigit|isgraph|islower\ sc_avoid_ctype_macros: @prohibit='\b($(ctype_re)) *\(' \ halt="don't use ctype macros (use c-ctype.h)" \ - $(_sc_search_regexp) + $(_sc_search_regexp) sc_prohibit_virBufferAdd_with_string_literal: @prohibit='\<virBufferAdd *\([^,]+, *"[^"]' \ @@ -415,10 +415,17 @@ sc_copyright_format: @require='Copyright .*Red 'Hat', Inc\.' \ containing='Copyright .*Red 'Hat \ halt='Red Hat copyright is missing Inc.' \ - $(_sc_search_regexp) + $(_sc_search_regexp) @prohibit='Copyright [^(].*Red 'Hat \ halt='consistently use (C) in Red Hat copyright' \ - $(_sc_search_regexp) + $(_sc_search_regexp) + +# Some functions/macros produce messages intended solely for developers +# and maintainers. Do not mark them for translation. +sc_prohibit_gettext_markup: + @prohibit='\<VIR_WARN0? *\(_\(' \ + halt='do not mark these strings for translation' \ + $(_sc_search_regexp) # We don't use this feature of maint.mk. prev_version_file = /dev/null -- 1.7.1.259.g3aef8

On Wed, May 19, 2010 at 04:47:18PM +0200, Jim Meyering wrote:
From: Jim Meyering <meyering@redhat.com>
* cfg.mk (sc_prohibit_gettext_markup): New rule, to enforce this policy. Contrary to most diagnostic-emitting functions, where we require _(...) markup, here, we require that _() *not* be used for certain functions (or function-like macros). --- cfg.mk | 19 +++++++++++++------ 1 files changed, 13 insertions(+), 6 deletions(-)
ACK Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

From: Jim Meyering <meyering@redhat.com> Run this command: git grep -l 'VIR_WARN("%s", "'|xargs perl -pi -e \ 's/VIR_WARN\("%s", "/VIR_WARN0("/' * src/phyp/phyp_driver.c (phypDomainGetInfo): Perform the above. (phypDomainCreateAndStart, phypUUIDTable_ReadFile): Likewise. --- src/phyp/phyp_driver.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c index cec99b1..b174fc9 100644 --- a/src/phyp/phyp_driver.c +++ b/src/phyp/phyp_driver.c @@ -1344,15 +1344,15 @@ phypDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info) if ((info->maxMem = phypGetLparMem(dom->conn, managed_system, dom->id, 0)) == 0) - VIR_WARN("%s", "Unable to determine domain's max memory."); + VIR_WARN0("Unable to determine domain's max memory."); if ((info->memory = phypGetLparMem(dom->conn, managed_system, dom->id, 1)) == 0) - VIR_WARN("%s", "Unable to determine domain's memory."); + VIR_WARN0("Unable to determine domain's memory."); if ((info->nrVirtCpu = phypGetLparCPU(dom->conn, managed_system, dom->id)) == 0) - VIR_WARN("%s", "Unable to determine domain's CPU."); + VIR_WARN0("Unable to determine domain's CPU."); return 0; } @@ -1416,14 +1416,14 @@ phypDomainCreateAndStart(virConnectPtr conn, /* checking if this name already exists on this system */ if (phypGetLparID(session, managed_system, def->name, conn) == -1) { - VIR_WARN("%s", "LPAR name already exists."); + VIR_WARN0("LPAR name already exists."); goto err; } /* checking if ID or UUID already exists on this system */ for (i = 0; i < uuid_table->nlpars; i++) { if (lpars[i]->id == def->id || lpars[i]->uuid == def->uuid) { - VIR_WARN("%s", "LPAR ID or UUID already exists."); + VIR_WARN0("LPAR ID or UUID already exists."); goto err; } } @@ -1782,7 +1782,7 @@ phypUUIDTable_ReadFile(virConnectPtr conn) int id; if ((fd = open(local_file, O_RDONLY)) == -1) { - VIR_WARN("%s", "Unable to write information to local file."); + VIR_WARN0("Unable to write information to local file."); goto err; } -- 1.7.1.259.g3aef8

On Wed, May 19, 2010 at 04:47:19PM +0200, Jim Meyering wrote:
From: Jim Meyering <meyering@redhat.com>
Run this command: git grep -l 'VIR_WARN("%s", "'|xargs perl -pi -e \ 's/VIR_WARN\("%s", "/VIR_WARN0("/' * src/phyp/phyp_driver.c (phypDomainGetInfo): Perform the above. (phypDomainCreateAndStart, phypUUIDTable_ReadFile): Likewise. --- src/phyp/phyp_driver.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)
ACK Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

From: Jim Meyering <meyering@redhat.com> * po/POTFILES.in: Remove src/util/logging.c and src/util/uuid.c. * src/phyp/phyp_driver.c (phypUUIDTable_ReadFile): Correct more VIR_WARN uses, now manually. (phypUUIDTable_Init, phypUUIDTable_Pull): Likewise. --- po/POTFILES.in | 2 -- src/phyp/phyp_driver.c | 12 ++++-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/po/POTFILES.in b/po/POTFILES.in index 88218bd..e08b8c8 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -76,14 +76,12 @@ src/util/hooks.c src/util/hostusb.c src/util/interface.c src/util/json.c -src/util/logging.c src/util/macvtap.c src/util/pci.c src/util/processinfo.c src/util/stats_linux.c src/util/storage_file.c src/util/util.c -src/util/uuid.c src/util/virterror.c src/util/xml.c src/vbox/vbox_driver.c diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c index b174fc9..8f4f310 100644 --- a/src/phyp/phyp_driver.c +++ b/src/phyp/phyp_driver.c @@ -1798,15 +1798,13 @@ phypUUIDTable_ReadFile(virConnectPtr conn) } uuid_table->lpars[i]->id = id; } else { - VIR_WARN("%s", - "Unable to read from information to local file."); + VIR_WARN0("Unable to read from information to local file."); goto err; } rc = read(fd, uuid_table->lpars[i]->uuid, VIR_UUID_BUFLEN); if (rc != VIR_UUID_BUFLEN) { - VIR_WARN("%s", - "Unable to read information to local file."); + VIR_WARN0("Unable to read information to local file."); goto err; } } @@ -1909,8 +1907,7 @@ phypUUIDTable_Init(virConnectPtr conn) uuid_table->lpars[i]->id = ids[i]; if (virUUIDGenerate(uuid_table->lpars[i]->uuid) < 0) - VIR_WARN("%s %d", "Unable to generate UUID for domain", - ids[i]); + VIR_WARN("Unable to generate UUID for domain %d", ids[i]); } } else { virReportOOMError(); @@ -2083,8 +2080,7 @@ phypUUIDTable_Pull(virConnectPtr conn) rc = libssh2_channel_read(channel, buffer, amount); if (rc > 0) { if (safewrite(fd, buffer, rc) != rc) - VIR_WARN("%s", - "Unable to write information to local file."); + VIR_WARN0("Unable to write information to local file."); got += rc; total += rc; -- 1.7.1.259.g3aef8

On Wed, May 19, 2010 at 04:47:20PM +0200, Jim Meyering wrote:
From: Jim Meyering <meyering@redhat.com>
* po/POTFILES.in: Remove src/util/logging.c and src/util/uuid.c. * src/phyp/phyp_driver.c (phypUUIDTable_ReadFile): Correct more VIR_WARN uses, now manually. (phypUUIDTable_Init, phypUUIDTable_Pull): Likewise. --- po/POTFILES.in | 2 -- src/phyp/phyp_driver.c | 12 ++++-------- 2 files changed, 4 insertions(+), 10 deletions(-) ACK
Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Wed, May 19, 2010 at 04:47:16PM +0200, Jim Meyering wrote:
From: Jim Meyering <meyering@redhat.com>
Approximately 60 messages were marked. Since these diagnostics are intended solely for developers and maintainers, encouraging translation is deemed to be counterproductive: http://thread.gmane.org/gmane.comp.emulators.libvirt/25050/focus=25052
Run this command: git grep -l VIR_WARN|xargs perl -pi -e \ 's/(VIR_WARN0?)\s*\(_\((".*?")\)/$1($2/' --- daemon/libvirtd.c | 6 +++--- src/lxc/lxc_container.c | 2 +- src/lxc/lxc_controller.c | 2 +- src/network/bridge_driver.c | 8 ++++---- src/qemu/qemu_conf.c | 12 ++++++------ src/qemu/qemu_driver.c | 32 ++++++++++++++++---------------- src/qemu/qemu_monitor_text.c | 22 +++++++++++----------- src/uml/uml_driver.c | 12 ++++++------ src/util/logging.c | 8 ++++---- src/util/pci.c | 8 ++++---- src/xen/proxy_internal.c | 6 +++--- 11 files changed, 59 insertions(+), 59 deletions(-)
ACK Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

Daniel P. Berrange wrote:
On Wed, May 19, 2010 at 04:47:16PM +0200, Jim Meyering wrote:
From: Jim Meyering <meyering@redhat.com>
Approximately 60 messages were marked. Since these diagnostics are intended solely for developers and maintainers, encouraging translation is deemed to be counterproductive: http://thread.gmane.org/gmane.comp.emulators.libvirt/25050/focus=25052
Run this command: git grep -l VIR_WARN|xargs perl -pi -e \ 's/(VIR_WARN0?)\s*\(_\((".*?")\)/$1($2/' --- daemon/libvirtd.c | 6 +++--- src/lxc/lxc_container.c | 2 +- src/lxc/lxc_controller.c | 2 +- src/network/bridge_driver.c | 8 ++++---- src/qemu/qemu_conf.c | 12 ++++++------ src/qemu/qemu_driver.c | 32 ++++++++++++++++---------------- src/qemu/qemu_monitor_text.c | 22 +++++++++++----------- src/uml/uml_driver.c | 12 ++++++------ src/util/logging.c | 8 ++++---- src/util/pci.c | 8 ++++---- src/xen/proxy_internal.c | 6 +++--- 11 files changed, 59 insertions(+), 59 deletions(-)
ACK
Thanks for the quick reviews. And for trimming the quoted text. I've pushed all 5.
participants (2)
-
Daniel P. Berrange
-
Jim Meyering