]> xenbits.xensource.com Git - libvirt.git/commitdiff
maint: mark translatable string args of VIR_ERROR
authorJim Meyering <meyering@redhat.com>
Thu, 20 May 2010 06:15:46 +0000 (08:15 +0200)
committerJim Meyering <meyering@redhat.com>
Thu, 20 May 2010 19:36:25 +0000 (21:36 +0200)
Run this:
  git grep -l 'VIR_ERROR\s*("'|xargs perl -pi -e \
    's/(VIR_ERROR)\s*\((".*?"),/$1(_($2),/'

15 files changed:
daemon/libvirtd.c
src/driver.c
src/libvirt.c
src/lxc/lxc_controller.c
src/node_device/node_device_hal.c
src/node_device/node_device_linux_sysfs.c
src/node_device/node_device_udev.c
src/phyp/phyp_driver.c
src/qemu/qemu_conf.c
src/qemu/qemu_driver.c
src/qemu/qemu_monitor.c
src/storage/storage_driver.c
src/uml/uml_driver.c
src/util/cgroup.c
src/util/util.c

index 89d1aef5fb0c821af64543d5d101c52a467b73e2..3d8498fb1e508ce32a180afa766e59021f7b2e5f 100644 (file)
@@ -817,7 +817,7 @@ static int qemudInitPaths(struct qemud_server *server,
 
  snprintf_error:
     if (ret)
-        VIR_ERROR("%s",
+        VIR_ERROR(_("%s"),
                   _("Resulting path too long for buffer in qemudInitPaths()"));
 
  cleanup:
index e6f3aaa9d0e8724213fcdab93dfd4a0a28bac772..a6f55580ab286b3b9b4b47369ad121cf01270229 100644 (file)
@@ -64,7 +64,7 @@ virDriverLoadModule(const char *name)
 
     handle = dlopen(modfile, RTLD_NOW | RTLD_LOCAL);
     if (!handle) {
-        VIR_ERROR("failed to load module %s %s", modfile, dlerror());
+        VIR_ERROR(_("failed to load module %s %s"), modfile, dlerror());
         goto cleanup;
     }
 
@@ -74,12 +74,12 @@ virDriverLoadModule(const char *name)
 
     regsym = dlsym(handle, regfunc);
     if (!regsym) {
-        VIR_ERROR("Missing module registration symbol %s", regfunc);
+        VIR_ERROR(_("Missing module registration symbol %s"), regfunc);
         goto cleanup;
     }
 
     if ((*regsym)() < 0) {
-        VIR_ERROR("Failed module registration %s", regfunc);
+        VIR_ERROR(_("Failed module registration %s"), regfunc);
         goto cleanup;
     }
 
index eb053375ae39a2e6fe901840f2f0b0eba05a7bc4..9d42c76ef124a0449dbccef8897b3c494225786d 100644 (file)
@@ -976,7 +976,7 @@ int virStateInitialize(int privileged) {
     for (i = 0 ; i < virStateDriverTabCount ; i++) {
         if (virStateDriverTab[i]->initialize &&
             virStateDriverTab[i]->initialize(privileged) < 0) {
-            VIR_ERROR("Initialization of %s state driver failed",
+            VIR_ERROR(_("Initialization of %s state driver failed"),
                       virStateDriverTab[i]->name);
             ret = -1;
         }
index 23fda7f763ba1653666f56b38d91a64805a36320..cffef52577032fc8bccd596cb1c9996fd95665b9 100644 (file)
@@ -313,7 +313,7 @@ static int lxcControllerMain(int monitor,
     fdArray[0].active = 0;
     fdArray[1].fd = contPty;
     fdArray[1].active = 0;
-    VIR_ERROR("monitor=%d client=%d appPty=%d contPty=%d", monitor,client, appPty, contPty);
+    VIR_ERROR(_("monitor=%d client=%d appPty=%d contPty=%d"), monitor,client, appPty, contPty);
     /* create the epoll fild descriptor */
     epollFd = epoll_create(2);
     if (0 > epollFd) {
index 235bf5606883622d90c78444fb63784747c719d9..c2b3c8f5b3173b6c8520352b4eacabae84526a96 100644 (file)
@@ -787,7 +787,7 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED)
 
  failure:
     if (dbus_error_is_set(&err)) {
-        VIR_ERROR("%s: %s", err.name, err.message);
+        VIR_ERROR(_("%s: %s"), err.name, err.message);
         dbus_error_free(&err);
     }
     virNodeDeviceObjListFree(&driverState->devs);
index 3e0c8cfe9e284c3454f50b04c815577e16a57fe9..142b8827d5969456fad1a7b21282e602af0e220b 100644 (file)
@@ -197,7 +197,7 @@ static int logStrToLong_ui(char const *s,
 
     ret = virStrToLong_ui(s, end_ptr, base, result);
     if (ret != 0) {
-        VIR_ERROR("Failed to convert '%s' to unsigned int", s);
+        VIR_ERROR(_("Failed to convert '%s' to unsigned int"), s);
     } else {
         VIR_DEBUG("Converted '%s' to unsigned int %u", s, *result);
     }
@@ -264,7 +264,7 @@ static int get_sriov_function(const char *device_link,
     device_path = canonicalize_file_name (device_link);
     if (device_path == NULL) {
         memset(errbuf, '\0', sizeof(errbuf));
-        VIR_ERROR("Failed to resolve device link '%s': '%s'", device_link,
+        VIR_ERROR(_("Failed to resolve device link '%s': '%s'"), device_link,
                   virStrerror(errno, errbuf, sizeof(errbuf)));
         goto out;
     }
@@ -277,7 +277,7 @@ static int get_sriov_function(const char *device_link,
     }
 
     if (parse_pci_config_address(config_address, *bdf) != 0) {
-        VIR_ERROR("Failed to parse PCI config address '%s'", config_address);
+        VIR_ERROR(_("Failed to parse PCI config address '%s'"), config_address);
         goto out;
     }
 
@@ -357,7 +357,7 @@ int get_virtual_functions_linux(const char *sysfs_path,
 
                 /* We should not get back SRIOV_NOT_FOUND in this
                  * case, so if we do, it's an error. */
-                VIR_ERROR("Failed to get SR IOV function from device link '%s'",
+                VIR_ERROR(_("Failed to get SR IOV function from device link '%s'"),
                           device_link);
                 goto out;
             } else {
index 2e97c26ffb340cb115b686602c9e89eef5bfdb32..ee905373030c5dd1f40ec71798a38eba89768aad 100644 (file)
@@ -57,7 +57,7 @@ static int udevStrToLong_ull(char const *s,
 
     ret = virStrToLong_ull(s, end_ptr, base, result);
     if (ret != 0) {
-        VIR_ERROR("Failed to convert '%s' to unsigned long long", s);
+        VIR_ERROR(_("Failed to convert '%s' to unsigned long long"), s);
     } else {
         VIR_DEBUG("Converted '%s' to unsigned long %llu", s, *result);
     }
@@ -75,7 +75,7 @@ static int udevStrToLong_ui(char const *s,
 
     ret = virStrToLong_ui(s, end_ptr, base, result);
     if (ret != 0) {
-        VIR_ERROR("Failed to convert '%s' to unsigned int", s);
+        VIR_ERROR(_("Failed to convert '%s' to unsigned int"), s);
     } else {
         VIR_DEBUG("Converted '%s' to unsigned int %u", s, *result);
     }
@@ -92,7 +92,7 @@ static int udevStrToLong_i(char const *s,
 
     ret = virStrToLong_i(s, end_ptr, base, result);
     if (ret != 0) {
-        VIR_ERROR("Failed to convert '%s' to int", s);
+        VIR_ERROR(_("Failed to convert '%s' to int"), s);
     } else {
         VIR_DEBUG("Converted '%s' to int %u", s, *result);
     }
@@ -737,7 +737,7 @@ static int udevGetSCSIType(unsigned int type, char **typestring)
             ret = -1;
             virReportOOMError();
         } else {
-            VIR_ERROR("Failed to find SCSI device type %d", type);
+            VIR_ERROR(_("Failed to find SCSI device type %d"), type);
         }
     }
 
@@ -802,7 +802,7 @@ static int udevProcessSCSIDevice(struct udev_device *device ATTRIBUTE_UNUSED,
 
 out:
     if (ret != 0) {
-        VIR_ERROR("Failed to process SCSI device with sysfs path '%s'",
+        VIR_ERROR(_("Failed to process SCSI device with sysfs path '%s'"),
                   def->sysfs_path);
     }
     return ret;
@@ -1165,7 +1165,7 @@ static int udevGetDeviceDetails(struct udev_device *device,
         ret = udevProcessStorage(device, def);
         break;
     default:
-        VIR_ERROR("Unknown device type %d", def->caps->type);
+        VIR_ERROR(_("Unknown device type %d"), def->caps->type);
         ret = -1;
         break;
     }
@@ -1286,7 +1286,7 @@ static int udevAddOneDevice(struct udev_device *device)
     nodeDeviceUnlock(driverState);
 
     if (dev == NULL) {
-        VIR_ERROR("Failed to create device for '%s'", def->name);
+        VIR_ERROR(_("Failed to create device for '%s'"), def->name);
         virNodeDeviceDefFree(def);
         goto out;
     }
@@ -1333,7 +1333,7 @@ static int udevEnumerateDevices(struct udev *udev)
 
     ret = udev_enumerate_scan_devices(udev_enumerate);
     if (0 != ret) {
-        VIR_ERROR("udev scan devices returned %d", ret);
+        VIR_ERROR(_("udev scan devices returned %d"), ret);
         goto out;
     }
 
@@ -1443,7 +1443,7 @@ udevGetDMIData(union _virNodeDevCapData *data)
     if (device == NULL) {
         device = udev_device_new_from_syspath(udev, DMI_DEVPATH_FALLBACK);
         if (device == NULL) {
-            VIR_ERROR("Failed to get udev device for syspath '%s' or '%s'",
+            VIR_ERROR(_("Failed to get udev device for syspath '%s' or '%s'"),
                       DMI_DEVPATH, DMI_DEVPATH_FALLBACK);
             goto out;
         }
@@ -1534,7 +1534,7 @@ static int udevSetupSystemDev(void)
 
     dev = virNodeDeviceAssignDef(&driverState->devs, def);
     if (dev == NULL) {
-        VIR_ERROR("Failed to create device for '%s'", def->name);
+        VIR_ERROR(_("Failed to create device for '%s'"), def->name);
         goto out;
     }
 
index 68b26133e65a5035895e488574731aa085f47151..4a1046151e5270dfdf41e018e8a0d83f2115fd2a 100644 (file)
@@ -1067,7 +1067,7 @@ phypListDomainsGeneric(virConnectPtr conn, int *ids, int nids,
                 break;
             else if (ret[i] == '\n') {
                 if (virStrToLong_i(id_c, &char_ptr, 10, &ids[got]) == -1) {
-                    VIR_ERROR("Cannot parse number from '%s'", id_c);
+                    VIR_ERROR(_("Cannot parse number from '%s'"), id_c);
                     goto err;
                 }
                 memset(id_c, 0, 10);
@@ -1520,7 +1520,7 @@ phypDomainSetCPU(virDomainPtr dom, unsigned int nvcpus)
         goto err;
 
     if (nvcpus > phypGetLparCPUMAX(dom)) {
-        VIR_ERROR("%s",
+        VIR_ERROR(_("%s"),
                   "You are trying to set a number of CPUs bigger than "
                   "the max possible..");
         goto err;
@@ -1547,7 +1547,7 @@ phypDomainSetCPU(virDomainPtr dom, unsigned int nvcpus)
     ret = phypExec(session, cmd, &exit_status, dom->conn);
 
     if (exit_status < 0) {
-        VIR_ERROR("%s",
+        VIR_ERROR(_("%s"),
                   "Possibly you don't have IBM Tools installed in your LPAR."
                   "Contact your support to enable this feature.");
         goto err;
@@ -1690,7 +1690,7 @@ phypBuildLpar(virConnectPtr conn, virDomainDefPtr def)
     ret = phypExec(session, cmd, &exit_status, conn);
 
     if (exit_status < 0) {
-        VIR_ERROR("%s\"%s\"", "Unable to create LPAR. Reason: ", ret);
+        VIR_ERROR(_("%s\"%s\""), "Unable to create LPAR. Reason: ", ret);
         goto err;
     }
 
@@ -1992,7 +1992,7 @@ phypUUIDTable_Push(virConnectPtr conn)
                 /* end of file */
                 break;
             } else {
-                VIR_ERROR("Failed to read from '%s'", local_file);
+                VIR_ERROR(_("Failed to read from '%s'"), local_file);
                 goto err;
             }
         }
index f37553c2382c069475cf2f7c0a6bc90cf58bfea7..ee67b4695f1d93b7683c17a9365798ee34581239 100644 (file)
@@ -260,7 +260,7 @@ int qemudLoadDriverConfig(struct qemud_driver *driver,
             }
             ctl = virCgroupControllerTypeFromString(pp->str);
             if (ctl < 0) {
-                VIR_ERROR("Unknown cgroup controller '%s'", pp->str);
+                VIR_ERROR(_("Unknown cgroup controller '%s'"), pp->str);
                 virConfFree(conf);
                 return -1;
             }
index 544cc88eacd49c3d5bf39ad06f42479de3dc2a60..8c34756ddc0006d2a9e4d0d036ec511df86a57d2 100644 (file)
@@ -1367,7 +1367,7 @@ static void qemuDomainSnapshotLoad(void *payload,
 
     virDomainObjLock(vm);
     if (virAsprintf(&snapDir, "%s/%s", baseDir, vm->def->name) < 0) {
-        VIR_ERROR("Failed to allocate memory for snapshot directory for domain %s",
+        VIR_ERROR(_("Failed to allocate memory for snapshot directory for domain %s"),
                    vm->def->name);
         goto cleanup;
     }
@@ -1377,7 +1377,7 @@ static void qemuDomainSnapshotLoad(void *payload,
 
     if (!(dir = opendir(snapDir))) {
         if (errno != ENOENT)
-            VIR_ERROR("Failed to open snapshot directory %s for domain %s: %s",
+            VIR_ERROR(_("Failed to open snapshot directory %s for domain %s: %s"),
                       snapDir, vm->def->name,
                       virStrerror(errno, ebuf, sizeof(ebuf)));
         goto cleanup;
@@ -1399,7 +1399,7 @@ static void qemuDomainSnapshotLoad(void *payload,
         ret = virFileReadAll(fullpath, 1024*1024*1, &xmlStr);
         if (ret < 0) {
             /* Nothing we can do here, skip this one */
-            VIR_ERROR("Failed to read snapshot file %s: %s", fullpath,
+            VIR_ERROR(_("Failed to read snapshot file %s: %s"), fullpath,
                       virStrerror(errno, ebuf, sizeof(ebuf)));
             VIR_FREE(fullpath);
             continue;
@@ -1408,7 +1408,7 @@ static void qemuDomainSnapshotLoad(void *payload,
         def = virDomainSnapshotDefParseString(xmlStr, 0);
         if (def == NULL) {
             /* Nothing we can do here, skip this one */
-            VIR_ERROR("Failed to parse snapshot XML from file '%s'", fullpath);
+            VIR_ERROR(_("Failed to parse snapshot XML from file '%s'"), fullpath);
             VIR_FREE(fullpath);
             VIR_FREE(xmlStr);
             continue;
index ec22c209afe92c66d56dd986bf938b7a429e6c23..b1254a119ae16e0c67d26ab83c87541d1b1a1cc6 100644 (file)
@@ -315,7 +315,7 @@ qemuMonitorIOProcess(qemuMonitorPtr mon)
 # if DEBUG_RAW_IO
     char *str1 = qemuMonitorEscapeNonPrintable(msg ? msg->txBuffer : "");
     char *str2 = qemuMonitorEscapeNonPrintable(mon->buffer);
-    VIR_ERROR("Process %d %p %p [[[[%s]]][[[%s]]]", (int)mon->bufferOffset, mon->msg, msg, str1, str2);
+    VIR_ERROR(_("Process %d %p %p [[[[%s]]][[[%s]]]"), (int)mon->bufferOffset, mon->msg, msg, str1, str2);
     VIR_FREE(str1);
     VIR_FREE(str2);
 # else
@@ -509,7 +509,7 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) {
 #endif
 
     if (mon->fd != fd || mon->watch != watch) {
-        VIR_ERROR("event from unexpected fd %d!=%d / watch %d!=%d", mon->fd, fd, mon->watch, watch);
+        VIR_ERROR(_("event from unexpected fd %d!=%d / watch %d!=%d"), mon->fd, fd, mon->watch, watch);
         failed = 1;
     } else {
         if (!mon->lastErrno &&
index 2c69ba994af564411f0416ed48a3bba1a43a34b3..b148e390b9757615aab4fc15b9879c9a935c0b88 100644 (file)
@@ -73,7 +73,7 @@ storageDriverAutostart(virStorageDriverStatePtr driver) {
             !virStoragePoolObjIsActive(pool)) {
             virStorageBackendPtr backend;
             if ((backend = virStorageBackendForType(pool->def->type)) == NULL) {
-                VIR_ERROR("Missing backend %d", pool->def->type);
+                VIR_ERROR(_("Missing backend %d"), pool->def->type);
                 virStoragePoolObjUnlock(pool);
                 continue;
             }
@@ -81,7 +81,7 @@ storageDriverAutostart(virStorageDriverStatePtr driver) {
             if (backend->startPool &&
                 backend->startPool(NULL, pool) < 0) {
                 virErrorPtr err = virGetLastError();
-                VIR_ERROR("Failed to autostart storage pool '%s': %s",
+                VIR_ERROR(_("Failed to autostart storage pool '%s': %s"),
                           pool->def->name, err ? err->message :
                           "no error message found");
                 virStoragePoolObjUnlock(pool);
@@ -92,7 +92,7 @@ storageDriverAutostart(virStorageDriverStatePtr driver) {
                 virErrorPtr err = virGetLastError();
                 if (backend->stopPool)
                     backend->stopPool(NULL, pool);
-                VIR_ERROR("Failed to autostart storage pool '%s': %s",
+                VIR_ERROR(_("Failed to autostart storage pool '%s': %s"),
                           pool->def->name, err ? err->message :
                           "no error message found");
                 virStoragePoolObjUnlock(pool);
@@ -634,7 +634,7 @@ storagePoolUndefine(virStoragePoolPtr obj) {
 
     if (unlink(pool->autostartLink) < 0 && errno != ENOENT && errno != ENOTDIR) {
         char ebuf[1024];
-        VIR_ERROR("Failed to delete autostart link '%s': %s",
+        VIR_ERROR(_("Failed to delete autostart link '%s': %s"),
                    pool->autostartLink, virStrerror(errno, ebuf, sizeof ebuf));
     }
 
index 55c8ef2ed544e0be9c20ff8a9649b4d69c5497f8..da8fd47622166c01628214ff2bf5e4e3c8b0e7f5 100644 (file)
@@ -791,10 +791,10 @@ static int umlCleanupTapDevices(virConnectPtr conn ATTRIBUTE_UNUSED,
             def->type != VIR_DOMAIN_NET_TYPE_NETWORK)
             continue;
 
-        VIR_ERROR("Cleanup '%s'", def->ifname);
+        VIR_ERROR(_("Cleanup '%s'"), def->ifname);
         err = brDeleteTap(brctl, def->ifname);
         if (err) {
-            VIR_ERROR("Cleanup failed %d", err);
+            VIR_ERROR(_("Cleanup failed %d"), err);
             ret = -1;
         }
     }
index 337fddb1b719f3c6d9c3188a238016c27cbb4613..35e9691abd8301c67b824c4034cbe2546ca52e55 100644 (file)
@@ -195,7 +195,7 @@ static int virCgroupDetect(virCgroupPtr group)
 
     rc = virCgroupDetectMounts(group);
     if (rc < 0) {
-        VIR_ERROR("Failed to detect mounts for %s", group->path);
+        VIR_ERROR(_("Failed to detect mounts for %s"), group->path);
         return rc;
     }
 
@@ -217,7 +217,7 @@ static int virCgroupDetect(virCgroupPtr group)
                 continue;
 
             if (!group->controllers[i].placement) {
-                VIR_ERROR("Could not find placement for controller %s at %s",
+                VIR_ERROR(_("Could not find placement for controller %s at %s"),
                           virCgroupControllerTypeToString(i),
                           group->controllers[i].placement);
                 rc = -ENOENT;
@@ -230,7 +230,7 @@ static int virCgroupDetect(virCgroupPtr group)
                       group->controllers[i].placement);
         }
     } else {
-        VIR_ERROR("Failed to detect mapping for %s", group->path);
+        VIR_ERROR(_("Failed to detect mapping for %s"), group->path);
     }
 
     return rc;
@@ -422,7 +422,7 @@ static int virCgroupCpuSetInherit(virCgroupPtr parent, virCgroupPtr group)
                                   inherit_values[i],
                                   &value);
         if (rc != 0) {
-            VIR_ERROR("Failed to get %s %d", inherit_values[i], rc);
+            VIR_ERROR(_("Failed to get %s %d"), inherit_values[i], rc);
             break;
         }
 
@@ -435,7 +435,7 @@ static int virCgroupCpuSetInherit(virCgroupPtr parent, virCgroupPtr group)
         VIR_FREE(value);
 
         if (rc != 0) {
-            VIR_ERROR("Failed to set %s %d", inherit_values[i], rc);
+            VIR_ERROR(_("Failed to set %s %d"), inherit_values[i], rc);
             break;
         }
     }
index e937d39254b028eb5f48e9640fb312a0e78ec083..92b9a0f89edaf456a798a2c57a9ed3491bff01af 100644 (file)
@@ -283,7 +283,7 @@ static int virClearCapabilities(void)
     capng_clear(CAPNG_SELECT_BOTH);
 
     if ((ret = capng_apply(CAPNG_SELECT_BOTH)) < 0) {
-        VIR_ERROR("cannot clear process capabilities %d", ret);
+        VIR_ERROR(_("cannot clear process capabilities %d"), ret);
         return -1;
     }