[libvirt PATCH 47/51] src: Update format strings in translated messages

Jiri Denemark jdenemar at redhat.com
Fri Mar 10 16:10:03 UTC 2023


Signed-off-by: Jiri Denemark <jdenemar at redhat.com>
---
 src/driver.c           |  6 ++----
 src/internal.h         | 20 +++++++++----------
 src/libvirt-domain.c   | 44 +++++++++++++++++++++---------------------
 src/libvirt-host.c     |  6 ++----
 src/libvirt-lxc.c      | 11 +++++------
 src/libvirt-network.c  |  8 ++++----
 src/libvirt-nodedev.c  |  4 ++--
 src/libvirt-nwfilter.c |  2 +-
 src/libvirt-qemu.c     |  4 ++--
 src/libvirt-secret.c   |  6 +++---
 src/libvirt-storage.c  | 13 ++++++-------
 src/libvirt.c          | 24 +++++++++++------------
 12 files changed, 70 insertions(+), 78 deletions(-)

diff --git a/src/driver.c b/src/driver.c
index 04cbbcd3ef..c7a9c2659f 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -297,16 +297,14 @@ virConnectValidateURIPath(const char *uriPath,
 
         if (STRNEQ(uriPath, "/system") && !compatSessionRoot) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("unexpected %s URI path '%s', try "
-                             "%s:///system"),
+                           _("unexpected %1$s URI path '%2$s', try %3$s:///system"),
                            entityName, uriPath, entityName);
             return false;
         }
     } else {
         if (STRNEQ(uriPath, "/session")) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("unexpected %s URI path '%s', try "
-                             "%s:///session"),
+                           _("unexpected %1$s URI path '%2$s', try %3$s:///session"),
                            entityName, uriPath, entityName);
             return false;
         }
diff --git a/src/internal.h b/src/internal.h
index 9dc34a0bf5..5a9e1c7cd0 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -273,13 +273,13 @@
         unsigned int __unsuppflags = flags & ~(supported); \
         if (__uiflags != flags) { \
             virReportInvalidArg(flags, \
-                                _("unsupported use of long flags in function %s"), \
+                                _("unsupported use of long flags in function %1$s"), \
                                 __FUNCTION__); \
             return retval; \
         } \
         if (__unsuppflags) { \
             virReportInvalidArg(flags, \
-                                _("unsupported flags (0x%x) in function %s"), \
+                                _("unsupported flags (0x%1$x) in function %2$s"), \
                                 __unsuppflags, __FUNCTION__); \
             return retval; \
         } \
@@ -302,13 +302,13 @@
         unsigned int __unsuppflags = flags & ~(supported); \
         if (__uiflags != flags) { \
             virReportInvalidArg(flags, \
-                                _("unsupported use of long flags in function %s"), \
+                                _("unsupported use of long flags in function %1$s"), \
                                 __FUNCTION__); \
             goto label; \
         } \
         if (__unsuppflags) { \
             virReportInvalidArg(flags, \
-                                _("unsupported flags (0x%x) in function %s"), \
+                                _("unsupported flags (0x%1$x) in function %2$s"), \
                                 __unsuppflags, __FUNCTION__); \
             goto label; \
         } \
@@ -333,8 +333,7 @@
     do { \
         if ((flags & FLAG1) && (flags & FLAG2)) { \
             virReportInvalidArg(ctl, \
-                                _("Flags '%s' and '%s' are mutually " \
-                                  "exclusive"), \
+                                _("Flags '%1$s' and '%2$s' are mutually exclusive"), \
                                 #FLAG1, #FLAG2); \
             return RET; \
         } \
@@ -357,8 +356,7 @@
     do { \
         if ((flags & FLAG1) && (flags & FLAG2)) { \
             virReportInvalidArg(ctl, \
-                                _("Flags '%s' and '%s' are mutually " \
-                                  "exclusive"), \
+                                _("Flags '%1$s' and '%2$s' are mutually exclusive"), \
                                 #FLAG1, #FLAG2); \
             goto LABEL; \
         } \
@@ -383,7 +381,7 @@
     do { \
         if ((flags & (FLAG1)) && !(flags & (FLAG2))) { \
             virReportInvalidArg(ctl, \
-                                _("Flag '%s' is required by flag '%s'"), \
+                                _("Flag '%1$s' is required by flag '%2$s'"), \
                                 #FLAG2, #FLAG1); \
             return RET; \
         } \
@@ -405,7 +403,7 @@
     do { \
         if ((flags & (FLAG1)) && !(flags & (FLAG2))) { \
             virReportInvalidArg(ctl, \
-                                _("Flag '%s' is required by flag '%s'"), \
+                                _("Flag '%1$s' is required by flag '%2$s'"), \
                                 #FLAG2, #FLAG1); \
             goto LABEL; \
         } \
@@ -481,7 +479,7 @@
 #define virCheckReadOnlyGoto(flags, label) \
     do { \
         if ((flags) & VIR_CONNECT_RO) { \
-            virReportRestrictedError(_("read only access prevents %s"), \
+            virReportRestrictedError(_("read only access prevents %1$s"), \
                                      __FUNCTION__); \
             goto label; \
         } \
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index 379057d9a7..9fd13250b1 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -1490,7 +1490,7 @@ virDomainCoreDumpWithFormat(virDomainPtr domain, const char *to,
     virCheckNonNullArgGoto(to, error);
 
     if (dumpformat >= VIR_DOMAIN_CORE_DUMP_FORMAT_LAST) {
-        virReportInvalidArg(flags, _("dumpformat '%d' is not supported"),
+        virReportInvalidArg(flags, _("dumpformat '%1$d' is not supported"),
                             dumpformat);
         goto error;
     }
@@ -1569,7 +1569,7 @@ virDomainScreenshot(virDomainPtr domain,
 
     if (domain->conn != stream->conn) {
         virReportInvalidArg(stream,
-                            _("stream must match connection of domain '%s'"),
+                            _("stream must match connection of domain '%1$s'"),
                             domain->name);
         goto error;
     }
@@ -1991,7 +1991,7 @@ virDomainGetMaxMemory(virDomainPtr domain)
         if (ret == 0)
             goto error;
         if ((unsigned long) ret != ret) {
-            virReportError(VIR_ERR_OVERFLOW, _("result too large: %llu"),
+            virReportError(VIR_ERR_OVERFLOW, _("result too large: %1$llu"),
                            ret);
             goto error;
         }
@@ -2040,7 +2040,7 @@ virDomainSetMaxMemory(virDomainPtr domain, unsigned long memory)
     virCheckNonZeroArgGoto(memory, error);
 
     if (virMemoryMaxValue(true) / 1024 <= memory) {
-        virReportError(VIR_ERR_OVERFLOW, _("input too large: %lu"),
+        virReportError(VIR_ERR_OVERFLOW, _("input too large: %1$lu"),
                        memory);
         goto error;
     }
@@ -2095,7 +2095,7 @@ virDomainSetMemory(virDomainPtr domain, unsigned long memory)
     virCheckNonZeroArgGoto(memory, error);
 
     if (virMemoryMaxValue(true) / 1024 <= memory) {
-        virReportError(VIR_ERR_OVERFLOW, _("input too large: %lu"),
+        virReportError(VIR_ERR_OVERFLOW, _("input too large: %1$lu"),
                        memory);
         goto error;
     }
@@ -2160,7 +2160,7 @@ virDomainSetMemoryFlags(virDomainPtr domain, unsigned long memory,
     virCheckNonZeroArgGoto(memory, error);
 
     if (virMemoryMaxValue(true) / 1024 <= memory) {
-        virReportError(VIR_ERR_OVERFLOW, _("input too large: %lu"),
+        virReportError(VIR_ERR_OVERFLOW, _("input too large: %1$lu"),
                        memory);
         goto error;
     }
@@ -5835,7 +5835,7 @@ virDomainBlockStats(virDomainPtr dom, const char *disk,
     virCheckNonNullArgGoto(stats, error);
     if (size > sizeof(stats2)) {
         virReportInvalidArg(size,
-                            _("size must not exceed %zu"),
+                            _("size must not exceed %1$zu"),
                             sizeof(stats2));
         goto error;
     }
@@ -5990,7 +5990,7 @@ virDomainInterfaceStats(virDomainPtr dom, const char *device,
     virCheckNonNullArgGoto(stats, error);
     if (size > sizeof(stats2)) {
         virReportInvalidArg(size,
-                            _("size must not exceed %zu"),
+                            _("size must not exceed %1$zu"),
                             sizeof(stats2));
         goto error;
     }
@@ -7358,14 +7358,14 @@ virDomainSendKey(virDomainPtr domain,
 
     if (codeset >= VIR_KEYCODE_SET_LAST) {
         virReportInvalidArg(codeset,
-                            _("Unsupported codeset '%d'"),
+                            _("Unsupported codeset '%1$d'"),
                             codeset);
         goto error;
     }
 
     if (nkeycodes > VIR_DOMAIN_SEND_KEY_MAX_KEYS) {
         virReportInvalidArg(nkeycodes,
-                            _("nkeycodes must be <= %d"),
+                            _("nkeycodes must be <= %1$d"),
                             VIR_DOMAIN_SEND_KEY_MAX_KEYS);
         goto error;
     }
@@ -7830,7 +7830,7 @@ virDomainGetVcpuPinInfo(virDomainPtr domain, int ncpumaps,
     virCheckPositiveArgGoto(maplen, error);
 
     if (VIR_INT_MULTIPLY_OVERFLOW(ncpumaps, maplen)) {
-        virReportError(VIR_ERR_OVERFLOW, _("input too large: %d * %d"),
+        virReportError(VIR_ERR_OVERFLOW, _("input too large: %1$d * %2$d"),
                        ncpumaps, maplen);
         goto error;
     }
@@ -8036,7 +8036,7 @@ virDomainGetVcpus(virDomainPtr domain, virVcpuInfoPtr info, int maxinfo,
         virCheckZeroArgGoto(maplen, error);
 
     if (cpumaps && VIR_INT_MULTIPLY_OVERFLOW(maxinfo, maplen)) {
-        virReportError(VIR_ERR_OVERFLOW, _("input too large: %d * %d"),
+        virReportError(VIR_ERR_OVERFLOW, _("input too large: %1$d * %2$d"),
                        maxinfo, maplen);
         goto error;
     }
@@ -9943,7 +9943,7 @@ virConnectDomainEventRegisterAny(virConnectPtr conn,
         virCheckDomainGoto(dom, error);
         if (dom->conn != conn) {
             virReportInvalidArg(dom,
-                                _("domain '%s' must match connection"),
+                                _("domain '%1$s' must match connection"),
                                 dom->name);
             goto error;
         }
@@ -9952,7 +9952,7 @@ virConnectDomainEventRegisterAny(virConnectPtr conn,
     virCheckNonNegativeArgGoto(eventID, error);
     if (eventID >= VIR_DOMAIN_EVENT_ID_LAST) {
         virReportInvalidArg(eventID,
-                            _("eventID must be less than %d"),
+                            _("eventID must be less than %1$d"),
                             VIR_DOMAIN_EVENT_ID_LAST);
         goto error;
     }
@@ -10328,7 +10328,7 @@ virDomainOpenConsole(virDomainPtr dom,
 
     if (conn != st->conn) {
         virReportInvalidArg(st,
-                            _("stream must match connection of domain '%s'"),
+                            _("stream must match connection of domain '%1$s'"),
                             dom->name);
         goto error;
     }
@@ -10394,7 +10394,7 @@ virDomainOpenChannel(virDomainPtr dom,
 
     if (conn != st->conn) {
         virReportInvalidArg(st,
-                            _("stream must match connection of domain '%s'"),
+                            _("stream must match connection of domain '%1$s'"),
                             dom->name);
         goto error;
     }
@@ -11295,14 +11295,14 @@ virDomainOpenGraphics(virDomainPtr dom,
 
     if (fstat(fd, &sb) < 0) {
         virReportSystemError(errno,
-                             _("Unable to access file descriptor %d"), fd);
+                             _("Unable to access file descriptor %1$d"), fd);
         goto error;
     }
 
 #ifndef WIN32
     if (!S_ISSOCK(sb.st_mode)) {
         virReportInvalidArg(fd,
-                            _("fd %d must be a socket"),
+                            _("fd %1$d must be a socket"),
                             fd);
         goto error;
     }
@@ -11672,7 +11672,7 @@ virDomainGetCPUStats(virDomainPtr domain,
         virCheckNullArgGoto(params, error);
 
     if (nparams && ncpus > UINT_MAX / nparams) {
-        virReportError(VIR_ERR_OVERFLOW, _("input too large: %u * %u"),
+        virReportError(VIR_ERR_OVERFLOW, _("input too large: %1$u * %2$u"),
                        nparams, ncpus);
         goto error;
     }
@@ -12673,7 +12673,7 @@ virDomainListGetStats(virDomainPtr *doms,
 
     if (!*doms) {
         virReportError(VIR_ERR_INVALID_ARG,
-                       _("doms array in %s must contain at least one domain"),
+                       _("doms array in %1$s must contain at least one domain"),
                        __FUNCTION__);
         goto cleanup;
     }
@@ -13381,13 +13381,13 @@ int virDomainSetLifecycleAction(virDomainPtr domain,
 
     if (type >= VIR_DOMAIN_LIFECYCLE_LAST) {
         virReportError(VIR_ERR_INVALID_ARG,
-                       _("invalid lifecycle type '%u'"), type);
+                       _("invalid lifecycle type '%1$u'"), type);
         goto error;
     }
 
     if (action >= VIR_DOMAIN_LIFECYCLE_ACTION_LAST) {
         virReportError(VIR_ERR_INVALID_ARG,
-                       _("invalid lifecycle action '%u'"), action);
+                       _("invalid lifecycle action '%1$u'"), action);
         goto error;
     }
 
diff --git a/src/libvirt-host.c b/src/libvirt-host.c
index a2ba347d54..e67b36812e 100644
--- a/src/libvirt-host.c
+++ b/src/libvirt-host.c
@@ -565,8 +565,7 @@ virNodeGetCPUStats(virConnectPtr conn,
     virCheckNonNegativeArgGoto(*nparams, error);
     if (cpuNum < 0 && cpuNum != VIR_NODE_CPU_STATS_ALL_CPUS) {
         virReportInvalidArg(cpuNum,
-                            _("cpuNum in %s only accepts %d as a negative "
-                              "value"),
+                            _("cpuNum in %1$s only accepts %2$d as a negative value"),
                             __FUNCTION__, VIR_NODE_CPU_STATS_ALL_CPUS);
         goto error;
     }
@@ -654,8 +653,7 @@ virNodeGetMemoryStats(virConnectPtr conn,
     virCheckNonNegativeArgGoto(*nparams, error);
     if (cellNum < 0 && cellNum != VIR_NODE_MEMORY_STATS_ALL_CELLS) {
         virReportInvalidArg(cpuNum,
-                            _("cellNum in %s only accepts %d as a negative "
-                              "value"),
+                            _("cellNum in %1$s only accepts %2$d as a negative value"),
                             __FUNCTION__, VIR_NODE_MEMORY_STATS_ALL_CELLS);
         goto error;
     }
diff --git a/src/libvirt-lxc.c b/src/libvirt-lxc.c
index ab7e88c1c5..ecc1207ca9 100644
--- a/src/libvirt-lxc.c
+++ b/src/libvirt-lxc.c
@@ -215,15 +215,14 @@ virDomainLxcEnterSecurityLabel(virSecurityModelPtr model,
 
             if (getcon(&ctx) < 0) {
                 virReportSystemError(errno,
-                                     _("unable to get PID %d security context"),
+                                     _("unable to get PID %1$d security context"),
                                      getpid());
                 goto error;
             }
 
             if (virStrcpy(oldlabel->label, ctx, VIR_SECURITY_LABEL_BUFLEN) < 0) {
                 virReportError(VIR_ERR_INTERNAL_ERROR,
-                               _("security label exceeds "
-                                 "maximum length: %d"),
+                               _("security label exceeds maximum length: %1$d"),
                                VIR_SECURITY_LABEL_BUFLEN - 1);
                 freecon(ctx);
                 goto error;
@@ -239,7 +238,7 @@ virDomainLxcEnterSecurityLabel(virSecurityModelPtr model,
 
         if (setexeccon(label->label) < 0) {
             virReportSystemError(errno,
-                            _("Cannot set context %s"),
+                            _("Cannot set context %1$s"),
                             label->label);
             goto error;
         }
@@ -251,7 +250,7 @@ virDomainLxcEnterSecurityLabel(virSecurityModelPtr model,
     } else if (STREQ(model->model, "apparmor")) {
 #ifdef WITH_APPARMOR
         if (aa_change_profile(label->label) < 0) {
-            virReportSystemError(errno, _("error changing profile to %s"),
+            virReportSystemError(errno, _("error changing profile to %1$s"),
                                  label->label);
             goto error;
         }
@@ -264,7 +263,7 @@ virDomainLxcEnterSecurityLabel(virSecurityModelPtr model,
         /* nothing todo */
     } else {
         virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED,
-                       _("Security model %s cannot be entered"),
+                       _("Security model %1$s cannot be entered"),
                        model->model);
         goto error;
     }
diff --git a/src/libvirt-network.c b/src/libvirt-network.c
index 50c4108641..236dfe2f5d 100644
--- a/src/libvirt-network.c
+++ b/src/libvirt-network.c
@@ -392,7 +392,7 @@ virNetworkLookupByUUIDString(virConnectPtr conn, const char *uuidstr)
 
     if (virUUIDParse(uuidstr, uuid) < 0) {
         virReportInvalidArg(uuidstr,
-                            _("uuidstr in %s must be a valid UUID"),
+                            _("uuidstr in %1$s must be a valid UUID"),
                             __FUNCTION__);
         goto error;
     }
@@ -1211,7 +1211,7 @@ virConnectNetworkEventRegisterAny(virConnectPtr conn,
         virCheckNetworkGoto(net, error);
         if (net->conn != conn) {
             virReportInvalidArg(net,
-                                _("network '%s' in %s must match connection"),
+                                _("network '%1$s' in %2$s must match connection"),
                                 net->name, __FUNCTION__);
             goto error;
         }
@@ -1221,7 +1221,7 @@ virConnectNetworkEventRegisterAny(virConnectPtr conn,
 
     if (eventID >= VIR_NETWORK_EVENT_ID_LAST) {
         virReportInvalidArg(eventID,
-                            _("eventID in %s must be less than %d"),
+                            _("eventID in %1$s must be less than %2$d"),
                             __FUNCTION__, VIR_NETWORK_EVENT_ID_LAST);
         goto error;
     }
@@ -1485,7 +1485,7 @@ virNetworkPortLookupByUUIDString(virNetworkPtr net,
 
     if (virUUIDParse(uuidstr, uuid) < 0) {
         virReportInvalidArg(uuidstr,
-                            _("uuidstr in %s must be a valid UUID"),
+                            _("uuidstr in %1$s must be a valid UUID"),
                             __FUNCTION__);
         goto error;
     }
diff --git a/src/libvirt-nodedev.c b/src/libvirt-nodedev.c
index 366d2cfdbe..f0f99bc020 100644
--- a/src/libvirt-nodedev.c
+++ b/src/libvirt-nodedev.c
@@ -952,7 +952,7 @@ virConnectNodeDeviceEventRegisterAny(virConnectPtr conn,
         virCheckNodeDeviceGoto(dev, error);
         if (dev->conn != conn) {
             virReportInvalidArg(dev,
-                                _("node device '%s' in %s must match connection"),
+                                _("node device '%1$s' in %2$s must match connection"),
                                 dev->name, __FUNCTION__);
             goto error;
         }
@@ -962,7 +962,7 @@ virConnectNodeDeviceEventRegisterAny(virConnectPtr conn,
 
     if (eventID >= VIR_NODE_DEVICE_EVENT_ID_LAST) {
         virReportInvalidArg(eventID,
-                            _("eventID in %s must be less than %d"),
+                            _("eventID in %1$s must be less than %2$d"),
                             __FUNCTION__, VIR_NODE_DEVICE_EVENT_ID_LAST);
         goto error;
     }
diff --git a/src/libvirt-nwfilter.c b/src/libvirt-nwfilter.c
index b0b53cb132..ff82cc3b7f 100644
--- a/src/libvirt-nwfilter.c
+++ b/src/libvirt-nwfilter.c
@@ -265,7 +265,7 @@ virNWFilterLookupByUUIDString(virConnectPtr conn, const char *uuidstr)
 
     if (virUUIDParse(uuidstr, uuid) < 0) {
         virReportInvalidArg(uuidstr,
-                            _("uuidstr in %s must be a valid UUID"),
+                            _("uuidstr in %1$s must be a valid UUID"),
                             __FUNCTION__);
         goto error;
     }
diff --git a/src/libvirt-qemu.c b/src/libvirt-qemu.c
index ace91e8ada..2898b71983 100644
--- a/src/libvirt-qemu.c
+++ b/src/libvirt-qemu.c
@@ -236,7 +236,7 @@ virDomainQemuAttach(virConnectPtr conn,
     virCheckNonZeroArgGoto(pid_value, error);
     if (pid != pid_value) {
         virReportInvalidArg(pid_value,
-                            _("pid_value in %s is too large"),
+                            _("pid_value in %1$s is too large"),
                             __FUNCTION__);
         goto error;
     }
@@ -380,7 +380,7 @@ virConnectDomainQemuMonitorEventRegister(virConnectPtr conn,
         virCheckDomainGoto(dom, error);
         if (dom->conn != conn) {
             virReportInvalidArg(dom,
-                                _("domain '%s' in %s must match connection"),
+                                _("domain '%1$s' in %2$s must match connection"),
                                 dom->name, __FUNCTION__);
             goto error;
         }
diff --git a/src/libvirt-secret.c b/src/libvirt-secret.c
index fa00570043..4d0c88745d 100644
--- a/src/libvirt-secret.c
+++ b/src/libvirt-secret.c
@@ -269,7 +269,7 @@ virSecretLookupByUUIDString(virConnectPtr conn, const char *uuidstr)
 
     if (virUUIDParse(uuidstr, uuid) < 0) {
         virReportInvalidArg(uuidstr,
-                            _("uuidstr in %s must be a valid UUID"),
+                            _("uuidstr in %1$s must be a valid UUID"),
                             __FUNCTION__);
         goto error;
     }
@@ -787,7 +787,7 @@ virConnectSecretEventRegisterAny(virConnectPtr conn,
             char uuidstr[VIR_UUID_STRING_BUFLEN];
             virUUIDFormat(secret->uuid, uuidstr);
             virReportInvalidArg(secret,
-                                _("secret '%s' in %s must match connection"),
+                                _("secret '%1$s' in %2$s must match connection"),
                                 uuidstr, __FUNCTION__);
             goto error;
         }
@@ -797,7 +797,7 @@ virConnectSecretEventRegisterAny(virConnectPtr conn,
 
     if (eventID >= VIR_SECRET_EVENT_ID_LAST) {
         virReportInvalidArg(eventID,
-                            _("eventID in %s must be less than %d"),
+                            _("eventID in %1$s must be less than %2$d"),
                             __FUNCTION__, VIR_SECRET_EVENT_ID_LAST);
         goto error;
     }
diff --git a/src/libvirt-storage.c b/src/libvirt-storage.c
index 84900340a7..db7660aac4 100644
--- a/src/libvirt-storage.c
+++ b/src/libvirt-storage.c
@@ -474,7 +474,7 @@ virStoragePoolLookupByUUIDString(virConnectPtr conn,
 
     if (virUUIDParse(uuidstr, uuid) < 0) {
         virReportInvalidArg(uuidstr,
-                            _("uuidstr in %s must be a valid UUID"),
+                            _("uuidstr in %1$s must be a valid UUID"),
                             __FUNCTION__);
         goto error;
     }
@@ -1713,7 +1713,7 @@ virStorageVolDownload(virStorageVolPtr vol,
 
     if (vol->conn != stream->conn) {
         virReportInvalidArg(stream,
-                            _("stream in %s must match connection of volume '%s'"),
+                            _("stream in %1$s must match connection of volume '%2$s'"),
                             __FUNCTION__, vol->name);
         goto error;
     }
@@ -1798,7 +1798,7 @@ virStorageVolUpload(virStorageVolPtr vol,
 
     if (vol->conn != stream->conn) {
         virReportInvalidArg(stream,
-                            _("stream in %s must match connection of volume '%s'"),
+                            _("stream in %1$s must match connection of volume '%2$s'"),
                             __FUNCTION__, vol->name);
         goto error;
     }
@@ -2258,8 +2258,7 @@ virStorageVolResize(virStorageVolPtr vol,
     if (capacity == 0 && !((flags & VIR_STORAGE_VOL_RESIZE_DELTA) ||
                            (flags & VIR_STORAGE_VOL_RESIZE_SHRINK))) {
         virReportInvalidArg(capacity,
-                            _("capacity in %s cannot be zero without 'delta' "
-                              "or 'shrink' flags set"),
+                            _("capacity in %1$s cannot be zero without 'delta' or 'shrink' flags set"),
                             __FUNCTION__);
         goto error;
     }
@@ -2403,7 +2402,7 @@ virConnectStoragePoolEventRegisterAny(virConnectPtr conn,
         virCheckStoragePoolGoto(pool, error);
         if (pool->conn != conn) {
             virReportInvalidArg(pool,
-                                _("storage pool '%s' in %s must match connection"),
+                                _("storage pool '%1$s' in %2$s must match connection"),
                                 pool->name, __FUNCTION__);
             goto error;
         }
@@ -2413,7 +2412,7 @@ virConnectStoragePoolEventRegisterAny(virConnectPtr conn,
 
     if (eventID >= VIR_STORAGE_POOL_EVENT_ID_LAST) {
         virReportInvalidArg(eventID,
-                            _("eventID in %s must be less than %d"),
+                            _("eventID in %1$s must be less than %2$d"),
                             __FUNCTION__, VIR_STORAGE_POOL_EVENT_ID_LAST);
         goto error;
     }
diff --git a/src/libvirt.c b/src/libvirt.c
index 748f2d8ba0..03e878300f 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -519,7 +519,7 @@ virRegisterConnectDriver(virConnectDriver *driver,
     virCheckNonNullArgReturn(driver, -1);
     if (virConnectDriverTabCount >= MAX_DRIVERS) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Too many drivers, cannot register %s"),
+                       _("Too many drivers, cannot register %1$s"),
                        driver->hypervisorDriver->name);
         return -1;
     }
@@ -589,7 +589,7 @@ virRegisterStateDriver(virStateDriver *driver)
 
     if (virStateDriverTabCount >= MAX_DRIVERS) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Too many drivers, cannot register %s"),
+                       _("Too many drivers, cannot register %1$s"),
                        driver->name);
         return -1;
     }
@@ -657,13 +657,13 @@ virStateInitialize(bool privileged,
                                                         opaque);
             VIR_DEBUG("State init result %d (mandatory=%d)", ret, mandatory);
             if (ret == VIR_DRV_STATE_INIT_ERROR) {
-                VIR_ERROR(_("Initialization of %s state driver failed: %s"),
+                VIR_ERROR(_("Initialization of %1$s state driver failed: %2$s"),
                           virStateDriverTab[i]->name,
                           virGetLastErrorMessage());
                 return -1;
             }
             if (ret == VIR_DRV_STATE_INIT_SKIPPED && mandatory) {
-                VIR_ERROR(_("Initialization of mandatory %s state driver skipped"),
+                VIR_ERROR(_("Initialization of mandatory %1$s state driver skipped"),
                           virStateDriverTab[i]->name);
                 return -1;
             }
@@ -869,7 +869,7 @@ virConnectCheckURIMissingSlash(const char *uristr, virURI *uri)
     if (STREQ(uri->server, "session") ||
         STREQ(uri->server, "system")) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("invalid URI %s (maybe you want %s:///%s)"),
+                       _("invalid URI %1$s (maybe you want %2$s:///%3$s)"),
                        uristr, uri->scheme, uri->server);
         return -1;
     }
@@ -968,7 +968,7 @@ virConnectOpenInternal(const char *name,
 
         if (ret->uri->scheme == NULL) {
             virReportError(VIR_ERR_NO_CONNECT,
-                           _("URI '%s' does not include a driver name"),
+                           _("URI '%1$s' does not include a driver name"),
                            name);
             return NULL;
         }
@@ -986,7 +986,7 @@ virConnectOpenInternal(const char *name,
             if (strspn(ret->uri->scheme, "abcdefghijklmnopqrstuvwxyz")  !=
                 strlen(ret->uri->scheme)) {
                 virReportError(VIR_ERR_NO_CONNECT,
-                               _("URI scheme '%s' for embedded driver is not valid"),
+                               _("URI scheme '%1$s' for embedded driver is not valid"),
                                ret->uri->scheme);
                 return NULL;
             }
@@ -1056,7 +1056,7 @@ virConnectOpenInternal(const char *name,
              false)) {
             virReportErrorHelper(VIR_FROM_NONE, VIR_ERR_CONFIG_UNSUPPORTED,
                                  __FILE__, __FUNCTION__, __LINE__,
-                                 _("libvirt was built without the '%s' driver"),
+                                 _("libvirt was built without the '%1$s' driver"),
                                  ret->uri->scheme);
             return NULL;
         }
@@ -1106,7 +1106,7 @@ virConnectOpenInternal(const char *name,
 
         if (embed && !virConnectDriverTab[i]->embeddable) {
             virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                           _("Driver %s cannot be used in embedded mode"),
+                           _("Driver %1$s cannot be used in embedded mode"),
                            virConnectDriverTab[i]->hypervisorDriver->name);
             return NULL;
         }
@@ -1341,7 +1341,7 @@ virTypedParameterValidateSet(virConnectPtr conn,
         if (strnlen(params[i].field, VIR_TYPED_PARAM_FIELD_LENGTH) ==
             VIR_TYPED_PARAM_FIELD_LENGTH) {
             virReportInvalidArg(params,
-                                _("string parameter name '%.*s' too long"),
+                                _("string parameter name '%2$.*1$s' too long"),
                                 VIR_TYPED_PARAM_FIELD_LENGTH,
                                 params[i].field);
             return -1;
@@ -1350,13 +1350,13 @@ virTypedParameterValidateSet(virConnectPtr conn,
             if (string_okay) {
                 if (!params[i].value.s) {
                     virReportInvalidArg(params,
-                                        _("NULL string parameter '%s'"),
+                                        _("NULL string parameter '%1$s'"),
                                         params[i].field);
                     return -1;
                 }
             } else {
                 virReportInvalidArg(params,
-                                    _("string parameter '%s' unsupported"),
+                                    _("string parameter '%1$s' unsupported"),
                                     params[i].field);
                 return -1;
             }
-- 
2.39.2



More information about the libvir-list mailing list