[libvirt PATCH 13/51] hyperv: 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/hyperv/hyperv_driver.c         | 46 +++++++++++++++---------------
 src/hyperv/hyperv_network_driver.c |  4 +--
 src/hyperv/hyperv_util.c           |  3 +-
 src/hyperv/hyperv_wmi.c            | 43 ++++++++++++++--------------
 4 files changed, 47 insertions(+), 49 deletions(-)

diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c
index 5c3c810ba5..414274fdfd 100644
--- a/src/hyperv/hyperv_driver.c
+++ b/src/hyperv/hyperv_driver.c
@@ -69,7 +69,7 @@ hypervGetProcessorsByName(hypervPrivate *priv, const char *name,
 
     if (!processorList) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Could not look up processor(s) on '%s'"),
+                       _("Could not look up processor(s) on '%1$s'"),
                        name);
         return -1;
     }
@@ -155,7 +155,7 @@ hypervGetVirtualSystemByID(hypervPrivate *priv, int id,
         return -1;
 
     if (*computerSystemList == NULL) {
-        virReportError(VIR_ERR_NO_DOMAIN, _("No domain with ID %d"), id);
+        virReportError(VIR_ERR_NO_DOMAIN, _("No domain with ID %1$d"), id);
         return -1;
     }
 
@@ -179,7 +179,7 @@ hypervGetVirtualSystemByName(hypervPrivate *priv, const char *name,
 
     if (*computerSystemList == NULL) {
         virReportError(VIR_ERR_NO_DOMAIN,
-                       _("No domain with name %s"), name);
+                       _("No domain with name %1$s"), name);
         return -1;
     }
 
@@ -250,7 +250,7 @@ hypervLookupHostSystemBiosUuid(hypervPrivate *priv, unsigned char *uuid)
 
     if (virUUIDParse(computerSystem->data->UUID, uuid) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Could not parse UUID from string '%s'"),
+                       _("Could not parse UUID from string '%1$s'"),
                        computerSystem->data->UUID);
         return -1;
     }
@@ -384,7 +384,7 @@ hypervGetDeviceParentRasdFromDeviceId(const char *parentDeviceId,
         return 0;
 
     virReportError(VIR_ERR_INTERNAL_ERROR,
-                   _("Failed to locate parent device with ID '%s'"),
+                   _("Failed to locate parent device with ID '%1$s'"),
                    parentDeviceId);
 
     return -1;
@@ -424,13 +424,13 @@ hypervDomainCreateSCSIController(virDomainPtr domain, virDomainControllerDef *de
     if (def->model != VIR_DOMAIN_CONTROLLER_MODEL_SCSI_DEFAULT &&
         def->model != VIR_DOMAIN_CONTROLLER_MODEL_SCSI_AUTO) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("Unsupported SCSI controller model '%d'"), def->model);
+                       _("Unsupported SCSI controller model '%1$d'"), def->model);
         return -1;
     }
 
     if (def->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) {
         virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                       _("Unsupported SCSI controller address type '%d'"), def->info.type);
+                       _("Unsupported SCSI controller address type '%1$d'"), def->info.type);
         return -1;
     }
 
@@ -1327,7 +1327,7 @@ hypervDomainDefParseVirtualExtent(hypervPrivate *priv,
         disk->device = VIR_DOMAIN_DISK_DEVICE_FLOPPY;
     } else {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Unrecognized controller type %d"),
+                       _("Unrecognized controller type %1$d"),
                        controller->data->ResourceType);
         goto cleanup;
     }
@@ -1773,7 +1773,7 @@ hypervConnectOpen(virConnectPtr conn, virConnectAuthPtr auth,
 
     if (!os) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Could not get version information for host %s"),
+                       _("Could not get version information for host %1$s"),
                        conn->uri->server);
         goto cleanup;
     }
@@ -1818,7 +1818,7 @@ hypervConnectGetVersion(virConnectPtr conn, unsigned long *version)
 
     if (hypervParseVersionString(priv->version, &major, &minor, &micro) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Could not parse version from '%s'"),
+                       _("Could not parse version from '%1$s'"),
                        priv->version);
         return -1;
     }
@@ -1842,7 +1842,7 @@ hypervConnectGetVersion(virConnectPtr conn, unsigned long *version)
      */
     if (major > 99 || minor > 99 || micro > 999999) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Could not produce packed version number from '%s'"),
+                       _("Could not produce packed version number from '%1$s'"),
                        priv->version);
         return -1;
     }
@@ -1891,7 +1891,7 @@ hypervConnectGetMaxVcpus(virConnectPtr conn, const char *type G_GNUC_UNUSED)
 
     if (!processorSettingData) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Could not get maximum definition of Msvm_ProcessorSettingData for host %s"),
+                       _("Could not get maximum definition of Msvm_ProcessorSettingData for host %1$s"),
                        conn->uri->server);
         return -1;
     }
@@ -1943,7 +1943,7 @@ hypervNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info)
     /* Fill struct */
     if (virStrcpyStatic(info->model, processorList->data->Name) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("CPU model %s too long for destination"),
+                       _("CPU model %1$s too long for destination"),
                        processorList->data->Name);
         return -1;
     }
@@ -2059,7 +2059,7 @@ hypervDomainLookupByName(virConnectPtr conn, const char *name)
 
     if (computerSystem->next) {
         virReportError(VIR_ERR_MULTIPLE_DOMAINS,
-                       _("Multiple domains exist with the name '%s': repeat the request using a UUID"),
+                       _("Multiple domains exist with the name '%1$s': repeat the request using a UUID"),
                        name);
         return NULL;
     }
@@ -2127,7 +2127,7 @@ hypervDomainShutdownFlags(virDomainPtr domain, unsigned int flags)
     if (hypervGetWmiClass(Msvm_ShutdownComponent, &shutdown) < 0 ||
         !shutdown) {
         virReportError(VIR_ERR_OPERATION_FAILED,
-                       _("Could not get Msvm_ShutdownComponent for domain with UUID '%s'"),
+                       _("Could not get Msvm_ShutdownComponent for domain with UUID '%1$s'"),
                        uuid);
         return -1;
     }
@@ -2464,7 +2464,7 @@ hypervDomainScreenshot(virDomainPtr domain,
         temporaryDirectory = "/tmp";
     temporaryFile = g_strdup_printf("%s/libvirt.hyperv.screendump.XXXXXX", temporaryDirectory);
     if ((fd = g_mkstemp_full(temporaryFile, O_RDWR | O_CLOEXEC, S_IRUSR | S_IWUSR)) == -1) {
-        virReportSystemError(errno, _("g_mkstemp(\"%s\") failed"), temporaryFile);
+        virReportSystemError(errno, _("g_mkstemp(\"%1$s\") failed"), temporaryFile);
         goto cleanup;
     }
     unlinkTemporaryFile = true;
@@ -2705,7 +2705,7 @@ hypervDomainGetXMLDesc(virDomainPtr domain, unsigned int flags)
 
     if (virUUIDParse(computerSystem->data->Name, def->uuid) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Could not parse UUID from string '%s'"),
+                       _("Could not parse UUID from string '%1$s'"),
                        computerSystem->data->Name);
         return NULL;
     }
@@ -2928,7 +2928,7 @@ hypervDomainDefineXML(virConnectPtr conn, const char *xml)
     if ((domain = hypervDomainLookupByUUID(conn, def->uuid))) {
         char uuid_string[VIR_UUID_STRING_BUFLEN];
         virUUIDFormat(domain->uuid, uuid_string);
-        virReportError(VIR_ERR_DOM_EXIST, _("Domain already exists with UUID '%s'"), uuid_string);
+        virReportError(VIR_ERR_DOM_EXIST, _("Domain already exists with UUID '%1$s'"), uuid_string);
 
         // Don't use the 'exit' label, since we don't want to delete the existing domain.
         virObjectUnref(domain);
@@ -2978,7 +2978,7 @@ hypervDomainDefineXML(virConnectPtr conn, const char *xml)
     /* Attach serials */
     for (i = 0; i < def->nserials; i++) {
         if (hypervDomainAttachSerial(domain, def->serials[i]) < 0) {
-            virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not attach serial port %zu"), i);
+            virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not attach serial port %1$zu"), i);
             goto error;
         }
     }
@@ -2986,7 +2986,7 @@ hypervDomainDefineXML(virConnectPtr conn, const char *xml)
     /* Attach networks */
     for (i = 0; i < def->nnets; i++) {
         if (hypervDomainAttachSyntheticEthernetAdapter(domain, def->nets[i], hostname) < 0) {
-            virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not attach network %zu"), i);
+            virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not attach network %1$zu"), i);
             goto error;
         }
     }
@@ -3133,7 +3133,7 @@ hypervDomainAttachDeviceFlags(virDomainPtr domain, const char *xml, unsigned int
     case VIR_DOMAIN_DEVICE_AUDIO:
     case VIR_DOMAIN_DEVICE_CRYPTO:
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Attaching devices of type %d is not implemented"), dev->type);
+                       _("Attaching devices of type %1$d is not implemented"), dev->type);
         return -1;
     }
 
@@ -3290,7 +3290,7 @@ hypervNodeGetFreeMemory(virConnectPtr conn)
 
     if (!operatingSystem) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Could not get free memory for host %s"),
+                       _("Could not get free memory for host %1$s"),
                        conn->uri->server);
         return 0;
     }
@@ -3732,7 +3732,7 @@ hypervDebugHandler(const char *message, debug_level_e level,
     case DEBUG_LEVEL_ERROR:
     case DEBUG_LEVEL_CRITICAL:
     case DEBUG_LEVEL_ALWAYS:
-        VIR_ERROR(_("openwsman: %s"), message);
+        VIR_ERROR(_("openwsman: %1$s"), message);
         break;
 
     case DEBUG_LEVEL_WARNING:
diff --git a/src/hyperv/hyperv_network_driver.c b/src/hyperv/hyperv_network_driver.c
index a794a681b5..eefcaf05f6 100644
--- a/src/hyperv/hyperv_network_driver.c
+++ b/src/hyperv/hyperv_network_driver.c
@@ -40,7 +40,7 @@ hypervMsvmVirtualSwitchToNetwork(virConnectPtr conn, Msvm_VirtualEthernetSwitch
 
     if (virUUIDParse(virtualSwitch->data->Name, uuid) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Could not parse UUID from string '%s'"),
+                       _("Could not parse UUID from string '%1$s'"),
                        virtualSwitch->data->Name);
         return NULL;
     }
@@ -64,7 +64,7 @@ hypervNetworkLookup(virConnectPtr conn, const char *property, const char *value)
 
     if (!virtualSwitch) {
         virReportError(VIR_ERR_NO_NETWORK,
-                       _("No network found with property '%s' = '%s'"), property, value);
+                       _("No network found with property '%1$s' = '%2$s'"), property, value);
         return NULL;
     }
 
diff --git a/src/hyperv/hyperv_util.c b/src/hyperv/hyperv_util.c
index fe71e47285..37a1b1a249 100644
--- a/src/hyperv/hyperv_util.c
+++ b/src/hyperv/hyperv_util.c
@@ -55,8 +55,7 @@ hypervParseUri(hypervParsedUri **parsedUri, virURI *uri)
             if (STRNEQ((*parsedUri)->transport, "http") &&
                 STRNEQ((*parsedUri)->transport, "https")) {
                 virReportError(VIR_ERR_INVALID_ARG,
-                               _("Query parameter 'transport' has unexpected value "
-                                 "'%s' (should be http|https)"),
+                               _("Query parameter 'transport' has unexpected value '%1$s' (should be http|https)"),
                                (*parsedUri)->transport);
                 goto cleanup;
             }
diff --git a/src/hyperv/hyperv_wmi.c b/src/hyperv/hyperv_wmi.c
index 7dac5c46d1..8bc376e22f 100644
--- a/src/hyperv/hyperv_wmi.c
+++ b/src/hyperv/hyperv_wmi.c
@@ -70,7 +70,7 @@ hypervVerifyResponse(WsManClient *client, WsXmlDocH response,
 
     if (lastError != WS_LASTERR_OK) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Transport error during %s: %s (%d)"),
+                       _("Transport error during %1$s: %2$s (%3$d)"),
                        detail, wsman_transport_get_last_error_string(lastError),
                        lastError);
         return -1;
@@ -80,14 +80,14 @@ hypervVerifyResponse(WsManClient *client, WsXmlDocH response,
      * 400 (Bad Request) or 500 (Internal Server Error) */
     if (responseCode != 200 && responseCode != 400 && responseCode != 500) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Unexpected HTTP response during %s: %d"),
+                       _("Unexpected HTTP response during %1$s: %2$d"),
                        detail, responseCode);
         return -1;
     }
 
     if (response == NULL) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Empty response during %s"), detail);
+                       _("Empty response during %1$s"), detail);
         return -1;
     }
 
@@ -98,8 +98,7 @@ hypervVerifyResponse(WsManClient *client, WsXmlDocH response,
         wsmc_get_fault_data(response, fault);
 
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("SOAP fault during %s: code '%s', subcode '%s', "
-                         "reason '%s', detail '%s'"),
+                       _("SOAP fault during %1$s: code '%2$s', subcode '%3$s', reason '%4$s', detail '%5$s'"),
                        detail, NULLSTR(fault->code), NULLSTR(fault->subcode),
                        NULLSTR(fault->reason), NULLSTR(fault->fault_detail));
 
@@ -556,7 +555,7 @@ hypervSerializeEmbeddedParam(hypervParam *p, const char *resourceUri,
 
     if (!(xmlNodeParam = ws_xml_add_child(*methodNode, resourceUri, p->embedded.name,
                                           NULL))) {
-        virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not add child node %s"),
+        virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not add child node %1$s"),
                        p->embedded.name);
         return -1;
     }
@@ -780,11 +779,11 @@ hypervInvokeMethod(hypervPrivate *priv,
 
         if (faultReason)
             virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("WS-Management fault during %s invocation: %s"),
+                           _("WS-Management fault during %1$s invocation: %2$s"),
                            params->method, faultReason);
         else
             virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("Could not get return value for %s invocation"),
+                           _("Could not get return value for %1$s invocation"),
                            params->method);
 
         return -1;
@@ -801,7 +800,7 @@ hypervInvokeMethod(hypervPrivate *priv,
         instanceID = ws_xml_get_xpath_value(response, jobcode_instance_xpath);
         if (!instanceID) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("Could not get instance ID for %s invocation"),
+                           _("Could not get instance ID for %1$s invocation"),
                            params->method);
             return -1;
         }
@@ -854,11 +853,11 @@ hypervInvokeMethod(hypervPrivate *priv,
         }
         if (!completed && timeout < 0) {
             virReportError(VIR_ERR_OPERATION_TIMEOUT,
-                           _("Timeout waiting for %s invocation"), params->method);
+                           _("Timeout waiting for %1$s invocation"), params->method);
             return -1;
         }
     } else if (returnCode != CIM_RETURNCODE_COMPLETED_WITH_NO_ERROR) {
-        virReportError(VIR_ERR_INTERNAL_ERROR, _("Invocation of %s returned an error: %s (%d)"),
+        virReportError(VIR_ERR_INTERNAL_ERROR, _("Invocation of %1$s returned an error: %2$s (%3$d)"),
                        params->method, hypervReturnCodeToString(returnCode),
                        returnCode);
         return -1;
@@ -1155,14 +1154,14 @@ hypervInvokeMsvmComputerSystemRequestStateChange(virDomainPtr domain,
 
     if (returnValue == NULL) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Could not lookup %s for %s invocation"),
+                       _("Could not lookup %1$s for %2$s invocation"),
                        "ReturnValue", "RequestStateChange");
         return -1;
     }
 
     if (virStrToLong_i(returnValue, NULL, 10, &returnCode) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Could not parse return code from '%s'"), returnValue);
+                       _("Could not parse return code from '%1$s'"), returnValue);
         return -1;
     }
 
@@ -1172,7 +1171,7 @@ hypervInvokeMsvmComputerSystemRequestStateChange(virDomainPtr domain,
 
         if (instanceID == NULL) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("Could not lookup %s for %s invocation"),
+                           _("Could not lookup %1$s for %2$s invocation"),
                            "InstanceID", "RequestStateChange");
             return -1;
         }
@@ -1189,7 +1188,7 @@ hypervInvokeMsvmComputerSystemRequestStateChange(virDomainPtr domain,
 
             if (concreteJob == NULL) {
                 virReportError(VIR_ERR_INTERNAL_ERROR,
-                               _("Could not lookup %s for %s invocation"),
+                               _("Could not lookup %1$s for %2$s invocation"),
                                "Msvm_ConcreteJob", "RequestStateChange");
                 return -1;
             }
@@ -1214,20 +1213,20 @@ hypervInvokeMsvmComputerSystemRequestStateChange(virDomainPtr domain,
             case MSVM_CONCRETEJOB_JOBSTATE_EXCEPTION:
             case MSVM_CONCRETEJOB_JOBSTATE_SERVICE:
                 virReportError(VIR_ERR_INTERNAL_ERROR,
-                               _("Concrete job for %s invocation is in error state"),
+                               _("Concrete job for %1$s invocation is in error state"),
                                "RequestStateChange");
                 return -1;
 
             default:
                 virReportError(VIR_ERR_INTERNAL_ERROR,
-                               _("Concrete job for %s invocation is in unknown state"),
+                               _("Concrete job for %1$s invocation is in unknown state"),
                                "RequestStateChange");
                 return -1;
             }
         }
     } else if (returnCode != CIM_RETURNCODE_COMPLETED_WITH_NO_ERROR) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Invocation of %s returned an error: %s (%d)"),
+                       _("Invocation of %1$s returned an error: %2$s (%3$d)"),
                        "RequestStateChange", hypervReturnCodeToString(returnCode),
                        returnCode);
         return -1;
@@ -1330,7 +1329,7 @@ hypervMsvmComputerSystemToDomain(virConnectPtr conn,
 
     if (virUUIDParse(computerSystem->data->Name, uuid) < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Could not parse UUID from string '%s'"),
+                       _("Could not parse UUID from string '%1$s'"),
                        computerSystem->data->Name);
         return -1;
     }
@@ -1364,7 +1363,7 @@ hypervMsvmComputerSystemFromUUID(hypervPrivate *priv, const char *uuid,
         return -1;
 
     if (!*computerSystem) {
-        virReportError(VIR_ERR_NO_DOMAIN, _("No domain with UUID %s"), uuid);
+        virReportError(VIR_ERR_NO_DOMAIN, _("No domain with UUID %1$s"), uuid);
         return -1;
     }
 
@@ -1429,7 +1428,7 @@ hypervGetResourceAllocationSD(hypervPrivate *priv,
 
     if (!*data) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Could not look up resource allocation setting data with virtual system instance ID '%s'"),
+                       _("Could not look up resource allocation setting data with virtual system instance ID '%1$s'"),
                        id);
         return -1;
     }
@@ -1447,7 +1446,7 @@ hypervGetProcessorSD(hypervPrivate *priv,
 
     if (!*data) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Could not look up processor setting data with virtual system instance ID '%s'"),
+                       _("Could not look up processor setting data with virtual system instance ID '%1$s'"),
                        id);
         return -1;
     }
-- 
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