[libvirt PATCH 21/51] node_device: Update format strings in translated messages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---
 src/node_device/node_device_driver.c | 37 ++++++++++-----------
 src/node_device/node_device_udev.c   | 49 ++++++++++++++--------------
 2 files changed, 42 insertions(+), 44 deletions(-)

diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index 355ab31745..3cac25a10c 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -136,7 +136,7 @@ nodeDeviceUpdateDriverName(virNodeDeviceDef *def)
 
     if (virFileResolveLink(driver_link, &devpath) < 0) {
         virReportSystemError(errno,
-                             _("cannot resolve driver link %s"), driver_link);
+                             _("cannot resolve driver link %1$s"), driver_link);
         return -1;
     }
 
@@ -236,7 +236,7 @@ nodeDeviceObjFindByName(const char *name)
 
     if (!(obj = virNodeDeviceObjListFindByName(driver->devs, name))) {
         virReportError(VIR_ERR_NO_NODE_DEVICE,
-                       _("no node device with matching name '%s'"),
+                       _("no node device with matching name '%1$s'"),
                        name);
     }
 
@@ -735,7 +735,7 @@ nodeDeviceGetMdevctlCommand(virNodeDeviceDef *def,
     default:
         /* SHOULD NEVER HAPPEN */
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Unknown Command '%i'"), cmd_type);
+                       _("Unknown Command '%1$i'"), cmd_type);
         return NULL;
     }
 
@@ -744,7 +744,7 @@ nodeDeviceGetMdevctlCommand(virNodeDeviceDef *def,
     case MDEVCTL_CMD_DEFINE:
         if (!def->caps->data.mdev.parent_addr) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("unable to find parent device '%s'"), def->parent);
+                           _("unable to find parent device '%1$s'"), def->parent);
             return NULL;
         }
 
@@ -802,7 +802,7 @@ virMdevctlCreate(virNodeDeviceDef *def, char **uuid)
 
     if (status != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Unable to start mediated device: %s"),
+                       _("Unable to start mediated device: %1$s"),
                        MDEVCTL_ERROR(errmsg));
         return -1;
     }
@@ -832,7 +832,7 @@ virMdevctlDefine(virNodeDeviceDef *def, char **uuid)
 
     if (status != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Unable to define mediated device: %s"),
+                       _("Unable to define mediated device: %1$s"),
                        MDEVCTL_ERROR(errmsg));
         return -1;
     }
@@ -913,8 +913,7 @@ nodeDeviceCreateXML(virConnectPtr conn,
 
         if (device == NULL)
             virReportError(VIR_ERR_NO_NODE_DEVICE,
-                           _("no node device for '%s' with matching "
-                             "wwnn '%s' and wwpn '%s'"),
+                           _("no node device for '%1$s' with matching wwnn '%2$s' and wwpn '%3$s'"),
                            def->name, wwnn, wwpn);
     } else if (nodeDeviceHasCapability(def, VIR_NODE_DEV_CAP_MDEV)) {
         device = nodeDeviceCreateXMLMdev(conn, def);
@@ -944,7 +943,7 @@ virMdevctlStop(virNodeDeviceDef *def)
 
     if (status != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Unable to destroy '%s': %s"), def->name,
+                       _("Unable to destroy '%1$s': %2$s"), def->name,
                        MDEVCTL_ERROR(errmsg));
         return -1;
     }
@@ -970,7 +969,7 @@ virMdevctlUndefine(virNodeDeviceDef *def)
 
     if (status != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Unable to undefine mediated device: %s"),
+                       _("Unable to undefine mediated device: %1$s"),
                        MDEVCTL_ERROR(errmsg));
         return -1;
     }
@@ -996,7 +995,7 @@ virMdevctlStart(virNodeDeviceDef *def)
 
     if (status != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Unable to create mediated device: %s"),
+                       _("Unable to create mediated device: %1$s"),
                        MDEVCTL_ERROR(errmsg));
         return -1;
     }
@@ -1279,7 +1278,7 @@ nodeDeviceDestroy(virNodeDevicePtr device)
 
         if (!(obj = virNodeDeviceObjListFindByName(driver->devs, parent))) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("cannot find parent '%s' definition"), parent);
+                           _("cannot find parent '%1$s' definition"), parent);
             goto cleanup;
         }
 
@@ -1296,7 +1295,7 @@ nodeDeviceDestroy(virNodeDevicePtr device)
 
         if (!virNodeDeviceObjIsActive(obj)) {
             virReportError(VIR_ERR_OPERATION_INVALID,
-                           _("Device '%s' is not active"), def->name);
+                           _("Device '%1$s' is not active"), def->name);
             goto cleanup;
         }
 
@@ -1317,7 +1316,7 @@ nodeDeviceDestroy(virNodeDevicePtr device)
 
         if (fd < 0 && errno == EBUSY) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("Unable to destroy '%s': device in use"),
+                           _("Unable to destroy '%1$s': device in use"),
                            def->name);
             goto cleanup;
         }
@@ -1478,7 +1477,7 @@ nodeDeviceUndefine(virNodeDevice *device,
 
     if (!virNodeDeviceObjIsPersistent(obj)) {
         virReportError(VIR_ERR_OPERATION_INVALID,
-                       _("Node device '%s' is not defined"),
+                       _("Node device '%1$s' is not defined"),
                        def->name);
         goto cleanup;
     }
@@ -1712,7 +1711,7 @@ nodeDeviceUpdateMediatedDevices(void)
 
     if ((data.ndefs = virMdevctlListDefined(&defs, &errmsg)) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("failed to query mdevs from mdevctl: %s"), errmsg);
+                       _("failed to query mdevs from mdevctl: %1$s"), errmsg);
         return -1;
     }
 
@@ -1837,7 +1836,7 @@ nodeDeviceSetAutostart(virNodeDevice *device,
 
             if (virMdevctlSetAutostart(def, autostart, &errmsg) < 0) {
                 virReportError(VIR_ERR_INTERNAL_ERROR,
-                               _("Unable to set autostart on '%s': %s"),
+                               _("Unable to set autostart on '%1$s': %2$s"),
                                def->name,
                                errmsg && errmsg[0] != '\0' ? errmsg : _("Unknown Error"));
                 goto cleanup;
@@ -1923,7 +1922,7 @@ static int nodeDeviceDefValidateMdev(virNodeDeviceDef *def,
     obj = virNodeDeviceObjListFindByName(driver->devs, def->parent);
     if (!obj) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("invalid parent device '%s'"),
+                       _("invalid parent device '%1$s'"),
                        def->parent);
         return -1;
     }
@@ -1933,7 +1932,7 @@ static int nodeDeviceDefValidateMdev(virNodeDeviceDef *def,
      * device and stored it in the mdev caps */
     if (!mdev->parent_addr) {
         virReportError(VIR_ERR_PARSE_FAILED,
-                       _("Unable to find address for parent device '%s'"),
+                       _("Unable to find address for parent device '%1$s'"),
                        def->parent);
         return -1;
     }
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 5782aa43c8..4c37ec3189 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -186,14 +186,14 @@ udevGetIntProperty(struct udev_device *udev_device,
     str = udevGetDeviceProperty(udev_device, property_key);
     if (!str) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Missing udev property '%s' on '%s'"),
+                       _("Missing udev property '%1$s' on '%2$s'"),
                        property_key, udev_device_get_sysname(udev_device));
         return -1;
     }
 
     if (virStrToLong_i(str, NULL, base, value) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Failed to parse int '%s' from udev property '%s' on '%s'"),
+                       _("Failed to parse int '%1$s' from udev property '%2$s' on '%3$s'"),
                        str, property_key, udev_device_get_sysname(udev_device));
         return -1;
     }
@@ -212,14 +212,14 @@ udevGetUintProperty(struct udev_device *udev_device,
     str = udevGetDeviceProperty(udev_device, property_key);
     if (!str) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Missing udev property '%s' on '%s'"),
+                       _("Missing udev property '%1$s' on '%2$s'"),
                        property_key, udev_device_get_sysname(udev_device));
         return -1;
     }
 
     if (virStrToLong_ui(str, NULL, base, value) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Failed to parse uint '%s' from udev property '%s' on '%s'"),
+                       _("Failed to parse uint '%1$s' from udev property '%2$s' on '%3$s'"),
                        str, property_key, udev_device_get_sysname(udev_device));
         return -1;
     }
@@ -271,7 +271,7 @@ udevGetIntSysfsAttr(struct udev_device *udev_device,
 
     if (str && virStrToLong_i(str, NULL, base, value) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Failed to convert '%s' to int"), str);
+                       _("Failed to convert '%1$s' to int"), str);
         return -1;
     }
 
@@ -291,7 +291,7 @@ udevGetUintSysfsAttr(struct udev_device *udev_device,
 
     if (str && virStrToLong_ui(str, NULL, base, value) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Failed to convert '%s' to unsigned int"), str);
+                       _("Failed to convert '%1$s' to unsigned int"), str);
         return -1;
     }
 
@@ -310,7 +310,7 @@ udevGetUint64SysfsAttr(struct udev_device *udev_device,
 
     if (str && virStrToLong_ull(str, NULL, 0, value) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Failed to convert '%s' to unsigned long long"), str);
+                       _("Failed to convert '%1$s' to unsigned long long"), str);
         return -1;
     }
 
@@ -385,7 +385,7 @@ udevProcessPCI(struct udev_device *device,
         virStrToLong_ui(p + 1, &p, 16, &pci_dev->slot) < 0 || p == NULL ||
         virStrToLong_ui(p + 1, &p, 16, &pci_dev->function) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("failed to parse the PCI address from sysfs path: '%s'"),
+                       _("failed to parse the PCI address from sysfs path: '%1$s'"),
                        def->sysfs_path);
         goto cleanup;
     }
@@ -469,7 +469,7 @@ udevProcessMdevParent(struct udev_device *device,
 
     if (virMediatedDeviceParentGetAddress(def->sysfs_path, &mdev_parent->address) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Unable to find address for mdev parent device '%s'"),
+                       _("Unable to find address for mdev parent device '%1$s'"),
                        def->name);
         return -1;
     }
@@ -636,7 +636,7 @@ udevProcessSCSIHost(struct udev_device *device G_GNUC_UNUSED,
     if (!(str = STRSKIP(filename, "host")) ||
         virStrToLong_ui(str, NULL, 0, &scsi_host->host) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("failed to parse SCSI host '%s'"),
+                       _("failed to parse SCSI host '%1$s'"),
                        filename);
         return -1;
     }
@@ -745,7 +745,7 @@ udevProcessSCSIDevice(struct udev_device *device G_GNUC_UNUSED,
         virStrToLong_ui(p + 1, &p, 10, &scsi->target) < 0 || p == NULL ||
         virStrToLong_ui(p + 1, &p, 10, &scsi->lun) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("failed to parse the SCSI address from filename: '%s'"),
+                       _("failed to parse the SCSI address from filename: '%1$s'"),
                        filename);
         return -1;
     }
@@ -765,7 +765,7 @@ udevProcessSCSIDevice(struct udev_device *device G_GNUC_UNUSED,
  cleanup:
     if (ret != 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Failed to process SCSI device with sysfs path '%s'"),
+                       _("Failed to process SCSI device with sysfs path '%1$s'"),
                        def->sysfs_path);
     }
     return ret;
@@ -1062,13 +1062,13 @@ udevProcessMediatedDevice(struct udev_device *dev,
 
     if (virFileWaitForExists(linkpath, 10, 100) < 0) {
         virReportSystemError(errno,
-                             _("failed to wait for file '%s' to appear"),
+                             _("failed to wait for file '%1$s' to appear"),
                              linkpath);
         return -1;
     }
 
     if (virFileResolveLink(linkpath, &canonicalpath) < 0) {
-        virReportSystemError(errno, _("failed to resolve '%s'"), linkpath);
+        virReportSystemError(errno, _("failed to resolve '%1$s'"), linkpath);
         return -1;
     }
 
@@ -1088,7 +1088,7 @@ udevProcessMediatedDevice(struct udev_device *dev,
 
     if (!data->parent_addr) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Could not get parent of '%s'"),
+                       _("Could not get parent of '%1$s'"),
                        udev_device_get_syspath(dev));
         return -1;
     }
@@ -1113,7 +1113,7 @@ udevGetCCWAddress(const char *sysfs_path,
                                            &data->ccw_dev.ssid,
                                            &data->ccw_dev.devno) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("failed to parse the CCW address from sysfs path: '%s'"),
+                       _("failed to parse the CCW address from sysfs path: '%1$s'"),
                        sysfs_path);
         return -1;
     }
@@ -1188,7 +1188,7 @@ udevGetVDPACharDev(const char *sysfs_path,
 
             if (!virFileExists(chardev)) {
                 virReportError(VIR_ERR_INTERNAL_ERROR,
-                               _("vDPA chardev path '%s' does not exist"),
+                               _("vDPA chardev path '%1$s' does not exist"),
                                chardev);
                 return -1;
             }
@@ -1230,7 +1230,7 @@ udevProcessAPCard(struct udev_device *device,
         virStrToLong_ui(c + 1 + strlen("card"), NULL, 16,
                         &data->ap_card.ap_adapter) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("failed to parse the AP Card from sysfs path: '%s'"),
+                       _("failed to parse the AP Card from sysfs path: '%1$s'"),
                        def->sysfs_path);
         return -1;
     }
@@ -1255,7 +1255,7 @@ udevProcessAPQueue(struct udev_device *device,
         virStrToLong_ui(c + 1, &c, 16, &data->ap_queue.ap_adapter) < 0 ||
         virStrToLong_ui(c + 1, &c, 16, &data->ap_queue.ap_domain) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("failed to parse the AP Queue from sysfs path: '%s'"),
+                       _("failed to parse the AP Queue from sysfs path: '%1$s'"),
                        def->sysfs_path);
         return -1;
     }
@@ -1511,7 +1511,7 @@ udevSetParent(struct udev_device *device,
         parent_sysfs_path = udev_device_get_syspath(parent_device);
         if (parent_sysfs_path == NULL) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("Could not get syspath for parent of '%s'"),
+                           _("Could not get syspath for parent of '%1$s'"),
                            udev_device_get_syspath(parent_device));
             return -1;
         }
@@ -1795,8 +1795,7 @@ udevEventMonitorSanityCheck(udevEventData *priv,
     rc = udev_monitor_get_fd(priv->udev_monitor);
     if (fd != rc) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("File descriptor returned by udev %d does not "
-                         "match node device file descriptor %d"),
+                       _("File descriptor returned by udev %1$d does not match node device file descriptor %2$d"),
                        fd, rc);
 
         /* this is a non-recoverable error, let's remove the handle, so that we
@@ -1934,7 +1933,7 @@ udevGetDMIData(virNodeDevCapSystem *syscap)
         device = udev_device_new_from_syspath(udev, DMI_DEVPATH);
         if (device == NULL) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("Failed to get udev device for syspath '%s'"),
+                           _("Failed to get udev device for syspath '%1$s'"),
                            DMI_DEVPATH);
             return;
         }
@@ -2153,7 +2152,7 @@ monitorFileRecursively(udevEventData *udev,
  error:
     g_list_free_full(monitors, g_object_unref);
     virReportError(VIR_ERR_INTERNAL_ERROR,
-                   _("Unable to monitor directory: %s"), error->message);
+                   _("Unable to monitor directory: %1$s"), error->message);
     g_clear_error(&error);
     return NULL;
 }
@@ -2272,7 +2271,7 @@ nodeStateInitialize(bool privileged,
     }
 
     if (g_mkdir_with_parents(driver->stateDir, S_IRWXU) < 0) {
-        virReportSystemError(errno, _("cannot create state directory '%s'"),
+        virReportSystemError(errno, _("cannot create state directory '%1$s'"),
                              driver->stateDir);
         goto cleanup;
     }
-- 
2.39.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux