]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
esx: Mark error messages for translation
authorMatthias Bolte <matthias.bolte@googlemail.com>
Fri, 2 Apr 2010 19:34:31 +0000 (21:34 +0200)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Tue, 6 Apr 2010 17:24:24 +0000 (19:24 +0200)
Also define ESX_ERROR and ESX_VI_ERROR in a central place, instead of
defining them in each source file.

Add ESX_ERROR and ESX_VI_ERROR to the msg_gen_function list in cfg.mk.

Update po/POTFILES.in accordingly.

15 files changed:
cfg.mk
po/POTFILES.in
src/esx/esx_device_monitor.c
src/esx/esx_driver.c
src/esx/esx_interface_driver.c
src/esx/esx_network_driver.c
src/esx/esx_private.h
src/esx/esx_secret_driver.c
src/esx/esx_storage_driver.c
src/esx/esx_util.c
src/esx/esx_vi.c
src/esx/esx_vi.h
src/esx/esx_vi_methods.c
src/esx/esx_vi_types.c
src/esx/esx_vmx.c

diff --git a/cfg.mk b/cfg.mk
index 8ddda6e9bb51d178b3564f1bfb8c187045356b4d..b4fda89a692e4267aa8da2bac5aaf6e379ccf208 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -172,6 +172,8 @@ msg_gen_function += DEBUG0
 msg_gen_function += DISABLE_fprintf
 msg_gen_function += ERROR
 msg_gen_function += ERROR0
+msg_gen_function += ESX_ERROR
+msg_gen_function += ESX_VI_ERROR
 msg_gen_function += REMOTE_DEBUG
 msg_gen_function += ReportError
 msg_gen_function += VIR_FREE
index 417bfa1bc6cea5636e3b3e81c4a7eec9333915fd..215d6231a5b93a5b891f44a7f9a1dee7d6792b73 100644 (file)
@@ -18,6 +18,12 @@ src/cpu/cpu_generic.c
 src/cpu/cpu_map.c
 src/cpu/cpu_x86.c
 src/datatypes.c
+src/esx/esx_driver.c
+src/esx/esx_util.c
+src/esx/esx_vi.c
+src/esx/esx_vi_methods.c
+src/esx/esx_vi_types.c
+src/esx/esx_vmx.c
 src/interface/netcf_driver.c
 src/libvirt.c
 src/lxc/lxc_container.c
index 1962a118895802089601b58781849d27bb41ba99..5887ba0a27f201c51cb259d9d62cd79a1042b0bb 100644 (file)
@@ -25,7 +25,6 @@
 #include <config.h>
 
 #include "internal.h"
-#include "virterror_internal.h"
 #include "util.h"
 #include "memory.h"
 #include "logging.h"
 
 #define VIR_FROM_THIS VIR_FROM_ESX
 
-#define ESX_ERROR(conn, code, ...)                                            \
-    virReportErrorHelper(conn, VIR_FROM_ESX, code, __FILE__, __FUNCTION__,    \
-                         __LINE__, __VA_ARGS__)
-
 
 
 static virDrvOpenStatus
index 785f98b285f8f2afda24a05ca03fdc20a130d501..888ac10b59034632711c9735b5a8dc9aaecc0b60 100644 (file)
@@ -27,7 +27,6 @@
 #include <netdb.h>
 
 #include "internal.h"
-#include "virterror_internal.h"
 #include "domain_conf.h"
 #include "authhelper.h"
 #include "util.h"
 
 #define VIR_FROM_THIS VIR_FROM_ESX
 
-#define ESX_ERROR(code, ...)                                                  \
-    virReportErrorHelper(NULL, VIR_FROM_ESX, code, __FILE__, __FUNCTION__,    \
-                         __LINE__, __VA_ARGS__)
-
 static int esxDomainGetMaxVcpus(virDomainPtr domain);
 
 
@@ -84,8 +79,8 @@ esxSupportsLongMode(esxPrivate *priv)
     }
 
     if (hostSystem == NULL) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Could not retrieve the HostSystem object");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                  _("Could not retrieve the HostSystem object"));
         goto failure;
     }
 
@@ -108,9 +103,9 @@ esxSupportsLongMode(esxPrivate *priv)
                                "%*c%*c%c%*c:"_SKIP12":"_SKIP12":%*c%*c%*c%c",
                                &edxLongModeBit, &edxFirstBit) != 2) {
                         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                                  "HostSystem property 'hardware.cpuFeature[].edx' "
-                                  "with value '%s' doesn't have expected format "
-                                  "'----:----:----:----:----:----:----:----'",
+                                  _("HostSystem property 'hardware.cpuFeature[].edx' "
+                                    "with value '%s' doesn't have expected format "
+                                    "'----:----:----:----:----:----:----:----'"),
                                   hostCpuIdInfo->edx);
                         goto failure;
                     }
@@ -124,10 +119,10 @@ esxSupportsLongMode(esxPrivate *priv)
                         priv->supportsLongMode = esxVI_Boolean_False;
                     } else {
                         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                                  "Bit 29 (Long Mode) of HostSystem property "
-                                  "'hardware.cpuFeature[].edx' with value '%s' "
-                                  "has unexpected value '%c', expecting '0' "
-                                  "or '1'", hostCpuIdInfo->edx, edxLongModeBit);
+                                  _("Bit 29 (Long Mode) of HostSystem property "
+                                    "'hardware.cpuFeature[].edx' with value '%s' "
+                                    "has unexpected value '%c', expecting '0' "
+                                    "or '1'"), hostCpuIdInfo->edx, edxLongModeBit);
                         goto failure;
                     }
 
@@ -358,7 +353,7 @@ esxOpen(virConnectPtr conn, virConnectAuthPtr auth, int flags ATTRIBUTE_UNUSED)
         username = virRequestUsername(auth, "root", conn->uri->server);
 
         if (username == NULL) {
-            ESX_ERROR(VIR_ERR_AUTH_FAILED, "Username request failed");
+            ESX_ERROR(VIR_ERR_AUTH_FAILED, "%s", _("Username request failed"));
             goto failure;
         }
     }
@@ -370,7 +365,7 @@ esxOpen(virConnectPtr conn, virConnectAuthPtr auth, int flags ATTRIBUTE_UNUSED)
     password = virRequestPassword(auth, username, conn->uri->server);
 
     if (password == NULL) {
-        ESX_ERROR(VIR_ERR_AUTH_FAILED, "Password request failed");
+        ESX_ERROR(VIR_ERR_AUTH_FAILED, "%s", _("Password request failed"));
         goto failure;
     }
 
@@ -383,14 +378,14 @@ esxOpen(virConnectPtr conn, virConnectAuthPtr auth, int flags ATTRIBUTE_UNUSED)
         if (priv->host->productVersion != esxVI_ProductVersion_ESX35 &&
             priv->host->productVersion != esxVI_ProductVersion_ESX40) {
             ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "%s is neither an ESX 3.5 host nor an ESX 4.0 host",
+                      _("%s is neither an ESX 3.5 host nor an ESX 4.0 host"),
                       conn->uri->server);
             goto failure;
         }
     } else { /* GSX */
         if (priv->host->productVersion != esxVI_ProductVersion_GSX20) {
             ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "%s isn't a GSX 2.0 host", conn->uri->server);
+                      _("%s isn't a GSX 2.0 host"), conn->uri->server);
             goto failure;
         }
     }
@@ -457,16 +452,17 @@ esxOpen(virConnectPtr conn, virConnectAuthPtr auth, int flags ATTRIBUTE_UNUSED)
                     if (virStrcpyStatic(vCenterIpAddress,
                                         dynamicProperty->val->string) == NULL) {
                         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                                  "vCenter IP address %s too big for "
-                                  "destination", dynamicProperty->val->string);
+                                  _("vCenter IP address %s too big for "
+                                    "destination"),
+                                  dynamicProperty->val->string);
                         goto failure;
                     }
                 } else if (STRNEQ(vCenterIpAddress,
                            dynamicProperty->val->string)) {
                     ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                              "This host is managed by a vCenter with IP "
-                              "address %s, but a mismachting vCenter '%s' "
-                              "(%s) has been specified",
+                              _("This host is managed by a vCenter with IP "
+                                "address %s, but a mismachting vCenter '%s' "
+                                "(%s) has been specified"),
                               dynamicProperty->val->string, vCenter,
                               vCenterIpAddress);
                     goto failure;
@@ -477,8 +473,8 @@ esxOpen(virConnectPtr conn, virConnectAuthPtr auth, int flags ATTRIBUTE_UNUSED)
         }
 
         if (STREQ(vCenter, "*")) {
-            ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "This host is not managed by a vCenter");
+            ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                      _("This host is not managed by a vCenter"));
             goto failure;
         }
 
@@ -495,14 +491,14 @@ esxOpen(virConnectPtr conn, virConnectAuthPtr auth, int flags ATTRIBUTE_UNUSED)
         username = virRequestUsername(auth, "administrator", vCenter);
 
         if (username == NULL) {
-            ESX_ERROR(VIR_ERR_AUTH_FAILED, "Username request failed");
+            ESX_ERROR(VIR_ERR_AUTH_FAILED, "%s", _("Username request failed"));
             goto failure;
         }
 
         password = virRequestPassword(auth, username, vCenter);
 
         if (password == NULL) {
-            ESX_ERROR(VIR_ERR_AUTH_FAILED, "Password request failed");
+            ESX_ERROR(VIR_ERR_AUTH_FAILED, "%s", _("Password request failed"));
             goto failure;
         }
 
@@ -514,8 +510,8 @@ esxOpen(virConnectPtr conn, virConnectAuthPtr auth, int flags ATTRIBUTE_UNUSED)
         if (priv->vCenter->productVersion != esxVI_ProductVersion_VPX25 &&
             priv->vCenter->productVersion != esxVI_ProductVersion_VPX40) {
             ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "%s is neither a vCenter 2.5 server nor a vCenter "
-                      "4.0 server", conn->uri->server);
+                      _("%s is neither a vCenter 2.5 server nor a vCenter "
+                        "4.0 server"), conn->uri->server);
             goto failure;
         }
     }
@@ -613,8 +609,8 @@ esxSupportsVMotion(esxPrivate *priv)
     }
 
     if (hostSystem == NULL) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Could not retrieve the HostSystem object");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                  _("Could not retrieve the HostSystem object"));
         goto failure;
     }
 
@@ -688,7 +684,7 @@ esxGetVersion(virConnectPtr conn, unsigned long *version)
     if (virParseVersionString(priv->host->service->about->version,
                               version) < 0) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Could not parse version number from '%s'",
+                  _("Could not parse version number from '%s'"),
                   priv->host->service->about->version);
 
         return -1;
@@ -725,8 +721,8 @@ esxGetHostname(virConnectPtr conn)
     }
 
     if (hostSystem == NULL) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Could not retrieve the HostSystem object");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                  _("Could not retrieve the HostSystem object"));
         goto failure;
     }
 
@@ -754,8 +750,8 @@ esxGetHostname(virConnectPtr conn)
     }
 
     if (hostName == NULL || strlen(hostName) < 1) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Missing or empty 'hostName' property");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                  _("Missing or empty 'hostName' property"));
         goto failure;
     }
 
@@ -824,8 +820,8 @@ esxNodeGetInfo(virConnectPtr conn, virNodeInfoPtr nodeinfo)
     }
 
     if (hostSystem == NULL) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Could not retrieve the HostSystem object");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                  _("Could not retrieve the HostSystem object"));
         goto failure;
     }
 
@@ -906,7 +902,7 @@ esxNodeGetInfo(virConnectPtr conn, virNodeInfoPtr nodeinfo)
                            sizeof(nodeinfo->model) - 1,
                            sizeof(nodeinfo->model)) == NULL) {
                 ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                          "CPU Model %s too long for destination",
+                          _("CPU Model %s too long for destination"),
                           dynamicProperty->val->string);
                 goto failure;
             }
@@ -1003,7 +999,7 @@ esxListDomains(virConnectPtr conn, int *ids, int maxids)
                                                 &ids[count]) < 0 ||
             ids[count] <= 0) {
             ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "Failed to parse positive integer from '%s'",
+                      _("Failed to parse positive integer from '%s'"),
                       virtualMachine->obj->value);
             goto failure;
         }
@@ -1110,7 +1106,7 @@ esxDomainLookupByID(virConnectPtr conn, int id)
     }
 
     if (domain == NULL) {
-        ESX_ERROR(VIR_ERR_NO_DOMAIN, "No domain with ID %d", id);
+        ESX_ERROR(VIR_ERR_NO_DOMAIN, _("No domain with ID %d"), id);
     }
 
   cleanup:
@@ -1208,7 +1204,7 @@ esxDomainLookupByName(virConnectPtr conn, const char *name)
     }
 
     if (virtualMachine == NULL) {
-        ESX_ERROR(VIR_ERR_NO_DOMAIN, "No domain with name '%s'", name);
+        ESX_ERROR(VIR_ERR_NO_DOMAIN, _("No domain with name '%s'"), name);
         goto failure;
     }
 
@@ -1274,7 +1270,8 @@ esxDomainSuspend(virDomainPtr domain)
     }
 
     if (powerState != esxVI_VirtualMachinePowerState_PoweredOn) {
-        ESX_ERROR(VIR_ERR_OPERATION_INVALID, "Domain is not powered on");
+        ESX_ERROR(VIR_ERR_OPERATION_INVALID, "%s",
+                  _("Domain is not powered on"));
         goto failure;
     }
 
@@ -1285,7 +1282,7 @@ esxDomainSuspend(virDomainPtr domain)
     }
 
     if (taskInfoState != esxVI_TaskInfoState_Success) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "Could not suspend domain");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Could not suspend domain"));
         goto failure;
     }
 
@@ -1329,7 +1326,7 @@ esxDomainResume(virDomainPtr domain)
     }
 
     if (powerState != esxVI_VirtualMachinePowerState_Suspended) {
-        ESX_ERROR(VIR_ERR_OPERATION_INVALID, "Domain is not suspended");
+        ESX_ERROR(VIR_ERR_OPERATION_INVALID, "%s", _("Domain is not suspended"));
         goto failure;
     }
 
@@ -1340,7 +1337,7 @@ esxDomainResume(virDomainPtr domain)
     }
 
     if (taskInfoState != esxVI_TaskInfoState_Success) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "Could not resume domain");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Could not resume domain"));
         goto failure;
     }
 
@@ -1382,7 +1379,8 @@ esxDomainShutdown(virDomainPtr domain)
     }
 
     if (powerState != esxVI_VirtualMachinePowerState_PoweredOn) {
-        ESX_ERROR(VIR_ERR_OPERATION_INVALID, "Domain is not powered on");
+        ESX_ERROR(VIR_ERR_OPERATION_INVALID, "%s",
+                  _("Domain is not powered on"));
         goto failure;
     }
 
@@ -1427,7 +1425,8 @@ esxDomainReboot(virDomainPtr domain, unsigned int flags ATTRIBUTE_UNUSED)
     }
 
     if (powerState != esxVI_VirtualMachinePowerState_PoweredOn) {
-        ESX_ERROR(VIR_ERR_OPERATION_INVALID, "Domain is not powered on");
+        ESX_ERROR(VIR_ERR_OPERATION_INVALID, "%s",
+                  _("Domain is not powered on"));
         goto failure;
     }
 
@@ -1481,7 +1480,8 @@ esxDomainDestroy(virDomainPtr domain)
     }
 
     if (powerState != esxVI_VirtualMachinePowerState_PoweredOn) {
-        ESX_ERROR(VIR_ERR_OPERATION_INVALID, "Domain is not powered on");
+        ESX_ERROR(VIR_ERR_OPERATION_INVALID, "%s",
+                  _("Domain is not powered on"));
         goto failure;
     }
 
@@ -1492,7 +1492,7 @@ esxDomainDestroy(virDomainPtr domain)
     }
 
     if (taskInfoState != esxVI_TaskInfoState_Success) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "Could not destroy domain");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Could not destroy domain"));
         goto failure;
     }
 
@@ -1556,7 +1556,8 @@ esxDomainGetMaxMemory(virDomainPtr domain)
             }
 
             if (dynamicProperty->val->int32 < 0) {
-                ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "Got invalid memory size %d",
+                ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
+                          _("Got invalid memory size %d"),
                           dynamicProperty->val->int32);
             } else {
                 memoryMB = dynamicProperty->val->int32;
@@ -1616,7 +1617,7 @@ esxDomainSetMaxMemory(virDomainPtr domain, unsigned long memory)
 
     if (taskInfoState != esxVI_TaskInfoState_Success) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Could not set max-memory to %lu kilobytes", memory);
+                  _("Could not set max-memory to %lu kilobytes"), memory);
         goto failure;
     }
 
@@ -1670,7 +1671,7 @@ esxDomainSetMemory(virDomainPtr domain, unsigned long memory)
 
     if (taskInfoState != esxVI_TaskInfoState_Success) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Could not set memory to %lu kilobytes", memory);
+                  _("Could not set memory to %lu kilobytes"), memory);
         goto failure;
     }
 
@@ -1962,8 +1963,8 @@ esxDomainSetVcpus(virDomainPtr domain, unsigned int nvcpus)
     esxVI_TaskInfoState taskInfoState;
 
     if (nvcpus < 1) {
-        ESX_ERROR(VIR_ERR_INVALID_ARG,
-                  "Requested number of virtual CPUs must at least be 1");
+        ESX_ERROR(VIR_ERR_INVALID_ARG, "%s",
+                  _("Requested number of virtual CPUs must at least be 1"));
         goto failure;
     }
 
@@ -1979,8 +1980,8 @@ esxDomainSetVcpus(virDomainPtr domain, unsigned int nvcpus)
 
     if (nvcpus > maxVcpus) {
         ESX_ERROR(VIR_ERR_INVALID_ARG,
-                  "Requested number of virtual CPUs is greater than max "
-                  "allowable number of virtual CPUs for the domain: %d > %d",
+                  _("Requested number of virtual CPUs is greater than max "
+                    "allowable number of virtual CPUs for the domain: %d > %d"),
                   nvcpus, maxVcpus);
         goto failure;
     }
@@ -2004,7 +2005,7 @@ esxDomainSetVcpus(virDomainPtr domain, unsigned int nvcpus)
 
     if (taskInfoState != esxVI_TaskInfoState_Success) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Could not set number of virtual CPUs to %d", nvcpus);
+                  _("Could not set number of virtual CPUs to %d"), nvcpus);
         goto failure;
     }
 
@@ -2048,8 +2049,8 @@ esxDomainGetMaxVcpus(virDomainPtr domain)
     }
 
     if (hostSystem == NULL) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Could not retrieve the HostSystem object");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                  _("Could not retrieve the HostSystem object"));
         goto failure;
     }
 
@@ -2193,7 +2194,7 @@ esxDomainXMLFromNative(virConnectPtr conn, const char *nativeFormat,
 
     if (STRNEQ(nativeFormat, "vmware-vmx")) {
         ESX_ERROR(VIR_ERR_INVALID_ARG,
-                  "Unsupported config format '%s'", nativeFormat);
+                  _("Unsupported config format '%s'"), nativeFormat);
         return NULL;
     }
 
@@ -2222,7 +2223,7 @@ esxDomainXMLToNative(virConnectPtr conn, const char *nativeFormat,
 
     if (STRNEQ(nativeFormat, "vmware-vmx")) {
         ESX_ERROR(VIR_ERR_INVALID_ARG,
-                  "Unsupported config format '%s'", nativeFormat);
+                  _("Unsupported config format '%s'"), nativeFormat);
         return NULL;
     }
 
@@ -2373,7 +2374,8 @@ esxDomainCreate(virDomainPtr domain)
     }
 
     if (powerState != esxVI_VirtualMachinePowerState_PoweredOff) {
-        ESX_ERROR(VIR_ERR_OPERATION_INVALID, "Domain is not powered off");
+        ESX_ERROR(VIR_ERR_OPERATION_INVALID, "%s",
+                  _("Domain is not powered off"));
         goto failure;
     }
 
@@ -2384,7 +2386,7 @@ esxDomainCreate(virDomainPtr domain)
     }
 
     if (taskInfoState != esxVI_TaskInfoState_Success) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "Could not start domain");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Could not start domain"));
         goto failure;
     }
 
@@ -2446,9 +2448,9 @@ esxDomainDefineXML(virConnectPtr conn, const char *xml ATTRIBUTE_UNUSED)
 
     if (virtualMachine != NULL) {
         /* FIXME */
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Domain already exists, editing existing domains is not "
-                  "supported yet");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                  _("Domain already exists, editing existing domains is not "
+                    "supported yet"));
         goto failure;
     }
 
@@ -2467,9 +2469,9 @@ esxDomainDefineXML(virConnectPtr conn, const char *xml ATTRIBUTE_UNUSED)
      * datastore isn't perfect but should work in the majority of cases.
      */
     if (def->ndisks < 1) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Domain XML doesn't contain any disks, cannot deduce "
-                  "datastore and path for VMX file");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                  _("Domain XML doesn't contain any disks, cannot deduce "
+                    "datastore and path for VMX file"));
         goto failure;
     }
 
@@ -2482,16 +2484,16 @@ esxDomainDefineXML(virConnectPtr conn, const char *xml ATTRIBUTE_UNUSED)
     }
 
     if (disk == NULL) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Domain XML doesn't contain any file-based harddisks, "
-                  "cannot deduce datastore and path for VMX file");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                  _("Domain XML doesn't contain any file-based harddisks, "
+                    "cannot deduce datastore and path for VMX file"));
         goto failure;
     }
 
     if (disk->src == NULL) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "First file-based harddisk has no source, cannot deduce "
-                  "datastore and path for VMX file");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                  _("First file-based harddisk has no source, cannot deduce "
+                    "datastore and path for VMX file"));
         goto failure;
     }
 
@@ -2502,8 +2504,8 @@ esxDomainDefineXML(virConnectPtr conn, const char *xml ATTRIBUTE_UNUSED)
 
     if (! virFileHasSuffix(fileName, ".vmdk")) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Expecting source '%s' of first file-based harddisk to be a "
-                  "VMDK image", disk->src);
+                  _("Expecting source '%s' of first file-based harddisk to "
+                    "be a VMDK image"), disk->src);
         goto failure;
     }
 
@@ -2572,7 +2574,7 @@ esxDomainDefineXML(virConnectPtr conn, const char *xml ATTRIBUTE_UNUSED)
     }
 
     if (taskInfoState != esxVI_TaskInfoState_Success) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "Could not define domain");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Could not define domain"));
         goto failure;
     }
 
@@ -2641,8 +2643,8 @@ esxDomainUndefine(virDomainPtr domain)
 
     if (powerState != esxVI_VirtualMachinePowerState_Suspended &&
         powerState != esxVI_VirtualMachinePowerState_PoweredOff) {
-        ESX_ERROR(VIR_ERR_OPERATION_INVALID,
-                  "Domain is not suspended or powered off");
+        ESX_ERROR(VIR_ERR_OPERATION_INVALID, "%s",
+                  _("Domain is not suspended or powered off"));
         goto failure;
     }
 
@@ -2725,8 +2727,8 @@ esxDomainGetSchedulerParameters(virDomainPtr domain,
     int i = 0;
 
     if (*nparams < 3) {
-        ESX_ERROR(VIR_ERR_INVALID_ARG,
-                  "Parameter array must have space for 3 items");
+        ESX_ERROR(VIR_ERR_INVALID_ARG, "%s",
+                  _("Parameter array must have space for 3 items"));
         goto failure;
     }
 
@@ -2810,7 +2812,7 @@ esxDomainGetSchedulerParameters(virDomainPtr domain,
 
               default:
                 ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                          "Shares level has unknown value %d",
+                          _("Shares level has unknown value %d"),
                           (int)sharesInfo->level);
                 goto failure;
             }
@@ -2874,8 +2876,8 @@ esxDomainSetSchedulerParameters(virDomainPtr domain,
 
             if (params[i].value.l < 0) {
                 ESX_ERROR(VIR_ERR_INVALID_ARG,
-                          "Could not set reservation to %lld MHz, expecting "
-                          "positive value", params[i].value.l);
+                          _("Could not set reservation to %lld MHz, expecting "
+                            "positive value"), params[i].value.l);
                 goto failure;
             }
 
@@ -2888,8 +2890,8 @@ esxDomainSetSchedulerParameters(virDomainPtr domain,
 
             if (params[i].value.l < -1) {
                 ESX_ERROR(VIR_ERR_INVALID_ARG,
-                          "Could not set limit to %lld MHz, expecting "
-                          "positive value or -1 (unlimited)",
+                          _("Could not set limit to %lld MHz, expecting "
+                            "positive value or -1 (unlimited)"),
                           params[i].value.l);
                 goto failure;
             }
@@ -2928,14 +2930,14 @@ esxDomainSetSchedulerParameters(virDomainPtr domain,
 
                   default:
                     ESX_ERROR(VIR_ERR_INVALID_ARG,
-                              "Could not set shares to %d, expecting positive "
-                              "value or -1 (low), -2 (normal) or -3 (high)",
+                              _("Could not set shares to %d, expecting positive "
+                                "value or -1 (low), -2 (normal) or -3 (high)"),
                               params[i].value.i);
                     goto failure;
                 }
             }
         } else {
-            ESX_ERROR(VIR_ERR_INVALID_ARG, "Unknown field '%s'",
+            ESX_ERROR(VIR_ERR_INVALID_ARG, _("Unknown field '%s'"),
                       params[i].field);
             goto failure;
         }
@@ -2949,8 +2951,8 @@ esxDomainSetSchedulerParameters(virDomainPtr domain,
     }
 
     if (taskInfoState != esxVI_TaskInfoState_Success) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Could not change scheduler parameters");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                  _("Could not change scheduler parameters"));
         goto failure;
     }
 
@@ -3028,14 +3030,14 @@ esxDomainMigratePerform(virDomainPtr domain,
     esxVI_TaskInfoState taskInfoState;
 
     if (priv->vCenter == NULL) {
-        ESX_ERROR(VIR_ERR_INVALID_ARG,
-                  "Migration not possible without a vCenter");
+        ESX_ERROR(VIR_ERR_INVALID_ARG, "%s",
+                  _("Migration not possible without a vCenter"));
         goto failure;
     }
 
     if (dname != NULL) {
-        ESX_ERROR(VIR_ERR_INVALID_ARG,
-                  "Renaming domains on migration not supported");
+        ESX_ERROR(VIR_ERR_INVALID_ARG, "%s",
+                  _("Renaming domains on migration not supported"));
         goto failure;
     }
 
@@ -3086,12 +3088,12 @@ esxDomainMigratePerform(virDomainPtr domain,
          */
         if (eventList->fullFormattedMessage != NULL) {
             ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "Could not migrate domain, validation reported a "
-                      "problem: %s", eventList->fullFormattedMessage);
+                      _("Could not migrate domain, validation reported a "
+                        "problem: %s"), eventList->fullFormattedMessage);
         } else {
-            ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "Could not migrate domain, validation reported a "
-                      "problem");
+            ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                      _("Could not migrate domain, validation reported a "
+                        "problem"));
         }
 
         goto failure;
@@ -3109,9 +3111,9 @@ esxDomainMigratePerform(virDomainPtr domain,
     }
 
     if (taskInfoState != esxVI_TaskInfoState_Success) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Could not migrate domain, migration task finished with "
-                  "an error");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                  _("Could not migrate domain, migration task finished with "
+                    "an error"));
         goto failure;
     }
 
@@ -3201,8 +3203,8 @@ esxNodeGetFreeMemory(virConnectPtr conn)
     }
 
     if (resourcePoolResourceUsage == NULL) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Could not retrieve memory usage of resource pool");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                  _("Could not retrieve memory usage of resource pool"));
         goto failure;
     }
 
index fef324d51e3d20efb673b03909a54aa06f00f0b6..d58e3656241901d26094e7bd6f76e0b146646e17 100644 (file)
@@ -25,7 +25,6 @@
 #include <config.h>
 
 #include "internal.h"
-#include "virterror_internal.h"
 #include "util.h"
 #include "memory.h"
 #include "logging.h"
 
 #define VIR_FROM_THIS VIR_FROM_ESX
 
-#define ESX_ERROR(conn, code, ...)                                            \
-    virReportErrorHelper(conn, VIR_FROM_ESX, code, __FILE__, __FUNCTION__,    \
-                         __LINE__, __VA_ARGS__)
-
 
 
 static virDrvOpenStatus
index 49492d1e2fd51f73a3ad35dd9e8c0ee78f5cfe10..52f5e6599efa549ac92363927045f1e3eaf79afd 100644 (file)
@@ -25,7 +25,6 @@
 #include <config.h>
 
 #include "internal.h"
-#include "virterror_internal.h"
 #include "util.h"
 #include "memory.h"
 #include "logging.h"
 
 #define VIR_FROM_THIS VIR_FROM_ESX
 
-#define ESX_ERROR(conn, code, ...)                                            \
-    virReportErrorHelper(conn, VIR_FROM_ESX, code, __FILE__, __FUNCTION__,    \
-                         __LINE__, __VA_ARGS__)
-
 
 
 static virDrvOpenStatus
index f8aa9e8d8f029a54b8a21ed7c20ea3346c6ebcc1..19955a5c4f1a021943b3c3d3feb2c7d3871c892b 100644 (file)
 # define __ESX_PRIVATE_H__
 
 # include "internal.h"
+# include "virterror_internal.h"
 # include "capabilities.h"
 # include "esx_vi.h"
 
+# define ESX_ERROR(code, ...)                                                 \
+    virReportErrorHelper(NULL, VIR_FROM_ESX, code, __FILE__, __FUNCTION__,    \
+                         __LINE__, __VA_ARGS__)
+
 typedef struct _esxPrivate {
     esxVI_Context *host;
     esxVI_Context *vCenter;
index f8e030f9397199551ade9712d91a383e33342b01..2d54b3f1b6669ed2c36959e89910a986fd9949db 100644 (file)
@@ -24,7 +24,6 @@
 #include <config.h>
 
 #include "internal.h"
-#include "virterror_internal.h"
 #include "util.h"
 #include "memory.h"
 #include "logging.h"
 
 #define VIR_FROM_THIS VIR_FROM_ESX
 
-#define ESX_ERROR(conn, code, ...)                                            \
-    virReportErrorHelper(conn, VIR_FROM_ESX, code, __FILE__, __FUNCTION__,    \
-                         __LINE__, __VA_ARGS__)
-
 
 
 static virDrvOpenStatus
index accd0011e0d8ad92a91e512e2f8a311e5571aa4c..97b92a592954cafe0d800d8fa2e9ca954f8d1b93 100644 (file)
@@ -25,7 +25,6 @@
 #include <config.h>
 
 #include "internal.h"
-#include "virterror_internal.h"
 #include "util.h"
 #include "memory.h"
 #include "logging.h"
 
 #define VIR_FROM_THIS VIR_FROM_ESX
 
-#define ESX_ERROR(conn, code, ...)                                            \
-    virReportErrorHelper(conn, VIR_FROM_ESX, code, __FILE__, __FUNCTION__,    \
-                         __LINE__, __VA_ARGS__)
-
 
 
 static virDrvOpenStatus
index 801b4b026e297702fa2d1903808bcfd7970334dd..963f52ea39cb108a84a1203433675a9a5f546677 100644 (file)
 #include <netdb.h>
 
 #include "internal.h"
-#include "virterror_internal.h"
 #include "datatypes.h"
 #include "qparams.h"
 #include "util.h"
 #include "memory.h"
 #include "logging.h"
 #include "uuid.h"
+#include "esx_private.h"
 #include "esx_util.h"
 
 #define VIR_FROM_THIS VIR_FROM_ESX
 
-#define ESX_ERROR(code, ...)                                                 \
-    virReportErrorHelper(NULL, VIR_FROM_ESX, code, __FILE__, __FUNCTION__,   \
-                         __LINE__, __VA_ARGS__)
-
 /* AI_ADDRCONFIG is missing on some systems. */
 #ifndef AI_ADDRCONFIG
 # define AI_ADDRCONFIG 0
@@ -101,8 +97,8 @@ esxUtil_ParseQuery(xmlURIPtr uri, char **transport, char **vCenter,
 
             if (STRNEQ(*transport, "http") && STRNEQ(*transport, "https")) {
                 ESX_ERROR(VIR_ERR_INVALID_ARG,
-                          "Query parameter 'transport' has unexpected value "
-                          "'%s' (should be http|https)", *transport);
+                          _("Query parameter 'transport' has unexpected value "
+                            "'%s' (should be http|https)"), *transport);
                 goto failure;
             }
         } else if (STRCASEEQ(queryParam->name, "vcenter")) {
@@ -124,8 +120,8 @@ esxUtil_ParseQuery(xmlURIPtr uri, char **transport, char **vCenter,
             if (virStrToLong_i(queryParam->value, NULL, 10, noVerify) < 0 ||
                 (*noVerify != 0 && *noVerify != 1)) {
                 ESX_ERROR(VIR_ERR_INVALID_ARG,
-                          "Query parameter 'no_verify' has unexpected value "
-                          "'%s' (should be 0 or 1)", queryParam->value);
+                          _("Query parameter 'no_verify' has unexpected value "
+                            "'%s' (should be 0 or 1)"), queryParam->value);
                 goto failure;
             }
         } else if (STRCASEEQ(queryParam->name, "auto_answer")) {
@@ -136,8 +132,8 @@ esxUtil_ParseQuery(xmlURIPtr uri, char **transport, char **vCenter,
             if (virStrToLong_i(queryParam->value, NULL, 10, autoAnswer) < 0 ||
                 (*autoAnswer != 0 && *autoAnswer != 1)) {
                 ESX_ERROR(VIR_ERR_INVALID_ARG,
-                          "Query parameter 'auto_answer' has unexpected value "
-                          "'%s' (should be 0 or 1)", queryParam->value);
+                          _("Query parameter 'auto_answer' has unexpected "
+                            "value '%s' (should be 0 or 1)"), queryParam->value);
                 goto failure;
             }
         } else {
@@ -213,7 +209,7 @@ esxUtil_ParseDatastoreRelatedPath(const char *datastoreRelatedPath,
     if (datastoreName == NULL || *datastoreName != NULL ||
         directoryName == NULL || *directoryName != NULL ||
         fileName == NULL || *fileName != NULL) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -234,8 +230,8 @@ esxUtil_ParseDatastoreRelatedPath(const char *datastoreRelatedPath,
     if (sscanf(datastoreRelatedPath, "[%a[^]%]] %a[^\n]", datastoreName,
                &directoryAndFileName) != 2) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Datastore related path '%s' doesn't have expected format "
-                  "'[<datastore>] <path>'", datastoreRelatedPath);
+                  _("Datastore related path '%s' doesn't have expected format "
+                    "'[<datastore>] <path>'"), datastoreRelatedPath);
         goto failure;
     }
 
@@ -250,7 +246,7 @@ esxUtil_ParseDatastoreRelatedPath(const char *datastoreRelatedPath,
 
         if (*separator == '\0') {
             ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "Datastore related path '%s' doesn't reference a file",
+                      _("Datastore related path '%s' doesn't reference a file"),
                       datastoreRelatedPath);
             goto failure;
         }
@@ -302,14 +298,14 @@ esxUtil_ResolveHostname(const char *hostname,
 
     if (errcode != 0) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "IP address lookup for host '%s' failed: %s", hostname,
+                  _("IP address lookup for host '%s' failed: %s"), hostname,
                   gai_strerror(errcode));
         return -1;
     }
 
     if (result == NULL) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "No IP address for host '%s' found: %s", hostname,
+                  _("No IP address for host '%s' found: %s"), hostname,
                   gai_strerror(errcode));
         return -1;
     }
@@ -319,7 +315,7 @@ esxUtil_ResolveHostname(const char *hostname,
 
     if (errcode != 0) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Formating IP address for host '%s' failed: %s", hostname,
+                  _("Formating IP address for host '%s' failed: %s"), hostname,
                   gai_strerror(errcode));
         freeaddrinfo(result);
         return -1;
@@ -347,13 +343,13 @@ esxUtil_GetConfigString(virConfPtr conf, const char *name, char **string,
         }
 
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Missing essential config entry '%s'", name);
+                  _("Missing essential config entry '%s'"), name);
         return -1;
     }
 
     if (value->type != VIR_CONF_STRING) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Config entry '%s' must be a string", name);
+                  _("Config entry '%s' must be a string"), name);
         return -1;
     }
 
@@ -363,7 +359,7 @@ esxUtil_GetConfigString(virConfPtr conf, const char *name, char **string,
         }
 
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Missing essential config entry '%s'", name);
+                  _("Missing essential config entry '%s'"), name);
         return -1;
     }
 
@@ -392,14 +388,14 @@ esxUtil_GetConfigUUID(virConfPtr conf, const char *name, unsigned char *uuid,
             return 0;
         } else {
             ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "Missing essential config entry '%s'", name);
+                      _("Missing essential config entry '%s'"), name);
             return -1;
         }
     }
 
     if (value->type != VIR_CONF_STRING) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Config entry '%s' must be a string", name);
+                  _("Config entry '%s' must be a string"), name);
         return -1;
     }
 
@@ -408,14 +404,14 @@ esxUtil_GetConfigUUID(virConfPtr conf, const char *name, unsigned char *uuid,
             return 0;
         } else {
             ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "Missing essential config entry '%s'", name);
+                      _("Missing essential config entry '%s'"), name);
             return -1;
         }
     }
 
     if (virUUIDParse(value->str, uuid) < 0) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Could not parse UUID from string '%s'", value->str);
+                  _("Could not parse UUID from string '%s'"), value->str);
         return -1;
     }
 
@@ -438,7 +434,7 @@ esxUtil_GetConfigLong(virConfPtr conf, const char *name, long long *number,
             return 0;
         } else {
             ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "Missing essential config entry '%s'", name);
+                      _("Missing essential config entry '%s'"), name);
             return -1;
         }
     }
@@ -449,7 +445,7 @@ esxUtil_GetConfigLong(virConfPtr conf, const char *name, long long *number,
                 return 0;
             } else {
                 ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                          "Missing essential config entry '%s'", name);
+                          _("Missing essential config entry '%s'"), name);
                 return -1;
             }
         }
@@ -458,13 +454,13 @@ esxUtil_GetConfigLong(virConfPtr conf, const char *name, long long *number,
             *number = -1;
         } else if (virStrToLong_ll(value->str, NULL, 10, number) < 0) {
             ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "Config entry '%s' must represent an integer value",
+                      _("Config entry '%s' must represent an integer value"),
                       name);
             return -1;
         }
     } else {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Config entry '%s' must be a string", name);
+                  _("Config entry '%s' must be a string"), name);
         return -1;
     }
 
@@ -487,7 +483,7 @@ esxUtil_GetConfigBoolean(virConfPtr conf, const char *name, int *boolean_,
             return 0;
         } else {
             ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "Missing essential config entry '%s'", name);
+                      _("Missing essential config entry '%s'"), name);
             return -1;
         }
     }
@@ -498,7 +494,7 @@ esxUtil_GetConfigBoolean(virConfPtr conf, const char *name, int *boolean_,
                 return 0;
             } else {
                 ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                          "Missing essential config entry '%s'", name);
+                          _("Missing essential config entry '%s'"), name);
                 return -1;
             }
         }
@@ -509,13 +505,13 @@ esxUtil_GetConfigBoolean(virConfPtr conf, const char *name, int *boolean_,
             *boolean_ = 0;
         } else {
             ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "Config entry '%s' must represent a boolean value "
-                      "(true|false)", name);
+                      _("Config entry '%s' must represent a boolean value "
+                        "(true|false)"), name);
             return -1;
         }
     } else {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Config entry '%s' must be a string", name);
+                  _("Config entry '%s' must be a string"), name);
         return -1;
     }
 
index c1fd4b4bb2a49bac3359de59a157815755ec1d26..c37dfa10f99f7f41953262be8fbe8d0b98c4e197 100644 (file)
@@ -31,7 +31,6 @@
 #include "logging.h"
 #include "util.h"
 #include "uuid.h"
-#include "virterror_internal.h"
 #include "xml.h"
 #include "esx_vi.h"
 #include "esx_vi_methods.h"
 
 #define VIR_FROM_THIS VIR_FROM_ESX
 
-#define ESX_VI_ERROR(code, ...)                                               \
-    virReportErrorHelper(NULL, VIR_FROM_ESX, code, __FILE__, __FUNCTION__,    \
-                         __LINE__, __VA_ARGS__)
-
 #define ESX_VI__SOAP__REQUEST_HEADER                                          \
     "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"                            \
     "<soapenv:Envelope "                                                      \
@@ -252,7 +247,7 @@ esxVI_CURL_Perform(esxVI_Context *ctx, const char *url)
 
     if (errorCode != CURLE_OK) {
         ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                     "curl_easy_perform() returned an error: %s (%d) : %s",
+                     _("curl_easy_perform() returned an error: %s (%d) : %s"),
                      curl_easy_strerror(errorCode), errorCode, ctx->curl_error);
         return -1;
     }
@@ -262,16 +257,16 @@ esxVI_CURL_Perform(esxVI_Context *ctx, const char *url)
 
     if (errorCode != CURLE_OK) {
         ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                     "curl_easy_getinfo(CURLINFO_RESPONSE_CODE) returned an "
-                     "error: %s (%d) : %s", curl_easy_strerror(errorCode),
+                     _("curl_easy_getinfo(CURLINFO_RESPONSE_CODE) returned an "
+                       "error: %s (%d) : %s"), curl_easy_strerror(errorCode),
                      errorCode, ctx->curl_error);
         return -1;
     }
 
     if (responseCode < 0) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                     "curl_easy_getinfo(CURLINFO_RESPONSE_CODE) returned a "
-                     "negative response code");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                     _("curl_easy_getinfo(CURLINFO_RESPONSE_CODE) returned a "
+                       "negative response code"));
         return -1;
     }
 
@@ -282,17 +277,18 @@ esxVI_CURL_Perform(esxVI_Context *ctx, const char *url)
 
         if (errorCode != CURLE_OK) {
             ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                         "curl_easy_getinfo(CURLINFO_REDIRECT_URL) returned "
-                         "an error: %s (%d) : %s", curl_easy_strerror(errorCode),
+                         _("curl_easy_getinfo(CURLINFO_REDIRECT_URL) returned "
+                           "an error: %s (%d) : %s"),
+                         curl_easy_strerror(errorCode),
                          errorCode, ctx->curl_error);
         } else {
             ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                         "The server redirects from '%s' to '%s'", url,
+                         _("The server redirects from '%s' to '%s'"), url,
                          redirectUrl);
         }
 #else
         ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                     "The server redirects from '%s'", url);
+                     _("The server redirects from '%s'"), url);
 #endif
 
         return -1;
@@ -314,7 +310,7 @@ esxVI_Context_Connect(esxVI_Context *ctx, const char *url,
     if (ctx == NULL || url == NULL || ipAddress == NULL || username == NULL ||
         password == NULL || ctx->url != NULL || ctx->service != NULL ||
         ctx->curl_handle != NULL || ctx->curl_headers != NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         goto failure;
     }
 
@@ -326,7 +322,8 @@ esxVI_Context_Connect(esxVI_Context *ctx, const char *url,
     ctx->curl_handle = curl_easy_init();
 
     if (ctx->curl_handle == NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Could not initialize CURL");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                     _("Could not initialize CURL"));
         goto failure;
     }
 
@@ -345,7 +342,8 @@ esxVI_Context_Connect(esxVI_Context *ctx, const char *url,
                                           "Expect: nothing");
 
     if (ctx->curl_headers == NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Could not build CURL header list");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                     _("Could not build CURL header list"));
         goto failure;
     }
 
@@ -369,7 +367,8 @@ esxVI_Context_Connect(esxVI_Context *ctx, const char *url,
 #endif
 
     if (virMutexInit(&ctx->curl_lock) < 0) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Could not initialize CURL mutex");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                     _("Could not initialize CURL mutex"));
         goto failure;
     }
 
@@ -393,8 +392,8 @@ esxVI_Context_Connect(esxVI_Context *ctx, const char *url,
             ctx->apiVersion = esxVI_APIVersion_40;
         } else {
             ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                         "Expecting VI API major/minor version '2.5' or '4.0' "
-                         "but found '%s'", ctx->service->about->apiVersion);
+                         _("Expecting VI API major/minor version '2.5' or '4.0' "
+                           "but found '%s'"), ctx->service->about->apiVersion);
             goto failure;
         }
 
@@ -403,8 +402,8 @@ esxVI_Context_Connect(esxVI_Context *ctx, const char *url,
                 ctx->productVersion = esxVI_ProductVersion_GSX20;
             } else {
                 ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                             "Expecting GSX major/minor version '2.0' but "
-                             "found '%s'", ctx->service->about->version);
+                             _("Expecting GSX major/minor version '2.0' but "
+                               "found '%s'"), ctx->service->about->version);
                 goto failure;
             }
         } else if (STREQ(ctx->service->about->productLineId, "esx") ||
@@ -415,8 +414,8 @@ esxVI_Context_Connect(esxVI_Context *ctx, const char *url,
                 ctx->productVersion = esxVI_ProductVersion_ESX40;
             } else {
                 ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                             "Expecting ESX major/minor version '3.5' or "
-                             "'4.0' but found '%s'",
+                             _("Expecting ESX major/minor version '3.5' or "
+                               "'4.0' but found '%s'"),
                              ctx->service->about->version);
                 goto failure;
             }
@@ -427,21 +426,21 @@ esxVI_Context_Connect(esxVI_Context *ctx, const char *url,
                 ctx->productVersion = esxVI_ProductVersion_VPX40;
             } else {
                 ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                             "Expecting VPX major/minor version '2.5' or '4.0' "
-                             "but found '%s'", ctx->service->about->version);
+                             _("Expecting VPX major/minor version '2.5' or '4.0' "
+                               "but found '%s'"), ctx->service->about->version);
                 goto failure;
             }
         } else {
             ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                         "Expecting product 'gsx' or 'esx' or 'embeddedEsx' "
-                         "or 'vpx' but found '%s'",
+                         _("Expecting product 'gsx' or 'esx' or 'embeddedEsx' "
+                           "or 'vpx' but found '%s'"),
                          ctx->service->about->productLineId);
             goto failure;
         }
     } else {
         ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                     "Expecting VI API type 'HostAgent' or 'VirtualCenter' "
-                     "but found '%s'", ctx->service->about->apiType);
+                     _("Expecting VI API type 'HostAgent' or 'VirtualCenter' "
+                       "but found '%s'"), ctx->service->about->apiType);
         goto failure;
     }
 
@@ -466,9 +465,9 @@ esxVI_Context_Connect(esxVI_Context *ctx, const char *url,
     }
 
     if (datacenterList == NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                     "Could not retrieve the 'datacenter' object from the VI "
-                     "host/center");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                     _("Could not retrieve the 'datacenter' object from the "
+                       "VI host/center"));
         goto failure;
     }
 
@@ -494,9 +493,9 @@ esxVI_Context_Connect(esxVI_Context *ctx, const char *url,
     }
 
     if (ctx->vmFolder == NULL || ctx->hostFolder == NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                     "The 'datacenter' object is missing the "
-                     "'vmFolder'/'hostFolder' property");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                     _("The 'datacenter' object is missing the "
+                       "'vmFolder'/'hostFolder' property"));
         goto failure;
     }
 
@@ -519,7 +518,7 @@ esxVI_Context_DownloadFile(esxVI_Context *ctx, const char *url, char **content)
     int responseCode = 0;
 
     if (content == NULL || *content != NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         goto failure;
     }
 
@@ -538,7 +537,7 @@ esxVI_Context_DownloadFile(esxVI_Context *ctx, const char *url, char **content)
         goto failure;
     } else if (responseCode != 200) {
         ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                     "HTTP response code %d for download from '%s'",
+                     _("HTTP response code %d for download from '%s'"),
                      responseCode, url);
         goto failure;
     }
@@ -565,7 +564,7 @@ esxVI_Context_UploadFile(esxVI_Context *ctx, const char *url,
     int responseCode = 0;
 
     if (content == NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -584,7 +583,7 @@ esxVI_Context_UploadFile(esxVI_Context *ctx, const char *url,
         return -1;
     } else if (responseCode != 200 && responseCode != 201) {
         ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                     "HTTP response code %d for upload to '%s'",
+                     _("HTTP response code %d for upload to '%s'"),
                      responseCode, url);
         return -1;
     }
@@ -605,7 +604,7 @@ esxVI_Context_Execute(esxVI_Context *ctx, const char *methodName,
     xmlNodePtr responseNode = NULL;
 
     if (request == NULL || response == NULL || *response != NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         goto failure;
     }
 
@@ -642,14 +641,14 @@ esxVI_Context_Execute(esxVI_Context *ctx, const char *methodName,
 
         if ((*response)->document == NULL) {
             ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                         "Response for call to '%s' could not be parsed",
+                         _("Response for call to '%s' could not be parsed"),
                          methodName);
             goto failure;
         }
 
         if (xmlDocGetRootElement((*response)->document) == NULL) {
             ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                         "Response for call to '%s' is an empty XML document",
+                         _("Response for call to '%s' is an empty XML document"),
                          methodName);
             goto failure;
         }
@@ -657,8 +656,8 @@ esxVI_Context_Execute(esxVI_Context *ctx, const char *methodName,
         xpathContext = xmlXPathNewContext((*response)->document);
 
         if (xpathContext == NULL) {
-            ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                         "Could not create XPath context");
+            ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                         _("Could not create XPath context"));
             goto failure;
         }
 
@@ -673,23 +672,23 @@ esxVI_Context_Execute(esxVI_Context *ctx, const char *methodName,
 
             if ((*response)->node == NULL) {
                 ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                             "HTTP response code %d for call to '%s'. "
-                             "Fault is unknown, XPath evaluation failed",
+                             _("HTTP response code %d for call to '%s'. "
+                               "Fault is unknown, XPath evaluation failed"),
                              (*response)->responseCode, methodName);
                 goto failure;
             }
 
             if (esxVI_Fault_Deserialize((*response)->node, &fault) < 0) {
                 ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                             "HTTP response code %d for call to '%s'. "
-                             "Fault is unknown, deserialization failed",
+                             _("HTTP response code %d for call to '%s'. "
+                               "Fault is unknown, deserialization failed"),
                              (*response)->responseCode, methodName);
                 goto failure;
             }
 
             ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                         "HTTP response code %d for call to '%s'. "
-                         "Fault: %s - %s", (*response)->responseCode,
+                         _("HTTP response code %d for call to '%s'. "
+                           "Fault: %s - %s"), (*response)->responseCode,
                          methodName, fault->faultcode, fault->faultstring);
 
             /* FIXME: Dump raw response until detail part gets deserialized */
@@ -710,8 +709,8 @@ esxVI_Context_Execute(esxVI_Context *ctx, const char *methodName,
 
             if (responseNode == NULL) {
                 ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                             "XPath evaluation of response for call to '%s' "
-                             "failed", methodName);
+                             _("XPath evaluation of response for call to '%s' "
+                               "failed"), methodName);
                 goto failure;
             }
 
@@ -722,13 +721,13 @@ esxVI_Context_Execute(esxVI_Context *ctx, const char *methodName,
               case esxVI_Occurrence_RequiredItem:
                 if ((*response)->node == NULL) {
                     ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                                 "Call to '%s' returned an empty result, "
-                                 "expecting a non-empty result", methodName);
+                                 _("Call to '%s' returned an empty result, "
+                                   "expecting a non-empty result"), methodName);
                     goto failure;
                 } else if ((*response)->node->next != NULL) {
                     ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                                 "Call to '%s' returned a list, expecting "
-                                 "exactly one item", methodName);
+                                 _("Call to '%s' returned a list, expecting "
+                                   "exactly one item"), methodName);
                     goto failure;
                 }
 
@@ -737,8 +736,8 @@ esxVI_Context_Execute(esxVI_Context *ctx, const char *methodName,
               case esxVI_Occurrence_RequiredList:
                 if ((*response)->node == NULL) {
                     ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                                 "Call to '%s' returned an empty result, "
-                                 "expecting a non-empty result", methodName);
+                                 _("Call to '%s' returned an empty result, "
+                                   "expecting a non-empty result"), methodName);
                     goto failure;
                 }
 
@@ -748,8 +747,8 @@ esxVI_Context_Execute(esxVI_Context *ctx, const char *methodName,
                 if ((*response)->node != NULL &&
                     (*response)->node->next != NULL) {
                     ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                                 "Call to '%s' returned a list, expecting "
-                                 "exactly one item", methodName);
+                                 _("Call to '%s' returned a list, expecting "
+                                   "exactly one item"), methodName);
                     goto failure;
                 }
 
@@ -762,22 +761,22 @@ esxVI_Context_Execute(esxVI_Context *ctx, const char *methodName,
               case esxVI_Occurrence_None:
                 if ((*response)->node != NULL) {
                     ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                                 "Call to '%s' returned something, expecting "
-                                 "an empty result", methodName);
+                                 _("Call to '%s' returned something, expecting "
+                                   "an empty result"), methodName);
                     goto failure;
                 }
 
                 break;
 
               default:
-                ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                             "Invalid argument (occurrence)");
+                ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                             _("Invalid argument (occurrence)"));
                 goto failure;
             }
         }
     } else {
         ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                     "HTTP response code %d for call to '%s'",
+                     _("HTTP response code %d for call to '%s'"),
                      (*response)->responseCode, methodName);
         goto failure;
     }
@@ -830,7 +829,7 @@ esxVI_Enumeration_CastFromAnyType(const esxVI_Enumeration *enumeration,
     int i;
 
     if (anyType == NULL || value == NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -838,7 +837,7 @@ esxVI_Enumeration_CastFromAnyType(const esxVI_Enumeration *enumeration,
 
     if (anyType->type != enumeration->type) {
         ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                     "Expecting type '%s' but found '%s'",
+                     _("Expecting type '%s' but found '%s'"),
                      esxVI_Type_ToString(enumeration->type),
                      esxVI_Type_ToString(anyType->type));
         return -1;
@@ -852,7 +851,7 @@ esxVI_Enumeration_CastFromAnyType(const esxVI_Enumeration *enumeration,
     }
 
     ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                 "Unknown value '%s' for %s", anyType->value,
+                 _("Unknown value '%s' for %s"), anyType->value,
                  esxVI_Type_ToString(enumeration->type));
 
     return -1;
@@ -866,7 +865,7 @@ esxVI_Enumeration_Serialize(const esxVI_Enumeration *enumeration,
     const char *name = NULL;
 
     if (element == NULL || output == NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -882,7 +881,7 @@ esxVI_Enumeration_Serialize(const esxVI_Enumeration *enumeration,
     }
 
     if (name == NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -905,7 +904,7 @@ esxVI_Enumeration_Deserialize(const esxVI_Enumeration *enumeration,
     char *name = NULL;
 
     if (value == NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         goto failure;
     }
 
@@ -922,7 +921,7 @@ esxVI_Enumeration_Deserialize(const esxVI_Enumeration *enumeration,
         }
     }
 
-    ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Unknown value '%s' for %s",
+    ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, _("Unknown value '%s' for %s"),
                  name, esxVI_Type_ToString(enumeration->type));
 
   cleanup:
@@ -948,7 +947,7 @@ esxVI_List_Append(esxVI_List **list, esxVI_List *item)
     esxVI_List *next = NULL;
 
     if (list == NULL || item == NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -977,7 +976,7 @@ esxVI_List_DeepCopy(esxVI_List **destList, esxVI_List *srcList,
     esxVI_List *src = NULL;
 
     if (destList == NULL || *destList != NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         goto failure;
     }
 
@@ -1011,7 +1010,7 @@ esxVI_List_CastFromAnyType(esxVI_AnyType *anyType, esxVI_List **list,
 
     if (list == NULL || *list != NULL ||
         castFromAnyTypeFunc == NULL || freeFunc == NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -1021,7 +1020,7 @@ esxVI_List_CastFromAnyType(esxVI_AnyType *anyType, esxVI_List **list,
 
     if (! STRPREFIX(anyType->other, "ArrayOf")) {
         ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                     "Expecting type to begin with 'ArrayOf' but found '%s'",
+                     _("Expecting type to begin with 'ArrayOf' but found '%s'"),
                      anyType->other);
         return -1;
     }
@@ -1030,7 +1029,7 @@ esxVI_List_CastFromAnyType(esxVI_AnyType *anyType, esxVI_List **list,
          childNode = childNode->next) {
         if (childNode->type != XML_ELEMENT_NODE) {
             ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                         "Wrong XML element type %d", childNode->type);
+                         _("Wrong XML element type %d"), childNode->type);
             goto failure;
         }
 
@@ -1067,7 +1066,7 @@ esxVI_List_Serialize(esxVI_List *list, const char *element,
     esxVI_List *item = NULL;
 
     if (element == NULL || output == NULL || serializeFunc == NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -1093,7 +1092,7 @@ esxVI_List_Deserialize(xmlNodePtr node, esxVI_List **list,
 
     if (list == NULL || *list != NULL ||
         deserializeFunc == NULL || freeFunc == NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -1104,7 +1103,7 @@ esxVI_List_Deserialize(xmlNodePtr node, esxVI_List **list,
     for (; node != NULL; node = node->next) {
         if (node->type != XML_ELEMENT_NODE) {
             ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                         "Wrong XML element type %d", node->type);
+                         _("Wrong XML element type %d"), node->type);
             goto failure;
         }
 
@@ -1139,7 +1138,7 @@ int
 esxVI_Alloc(void **ptrptr, size_t size)
 {
     if (ptrptr == NULL || *ptrptr != NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -1163,7 +1162,7 @@ esxVI_BuildFullTraversalSpecItem(esxVI_SelectionSpec **fullTraversalSpecList,
     const char *currentSelectSetName = NULL;
 
     if (fullTraversalSpecList == NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -1214,7 +1213,7 @@ int
 esxVI_BuildFullTraversalSpecList(esxVI_SelectionSpec **fullTraversalSpecList)
 {
     if (fullTraversalSpecList == NULL || *fullTraversalSpecList != NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -1332,7 +1331,7 @@ esxVI_EnsureSession(esxVI_Context *ctx)
 #endif
 
     if (ctx->session == NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid call");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid call"));
         return -1;
     }
 
@@ -1383,9 +1382,9 @@ esxVI_EnsureSession(esxVI_Context *ctx)
             goto failure;
         }
     } else if (STRNEQ(ctx->session->key, currentSession->key)) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                     "Key of the current session differs from the key at "
-                     "last login");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                     _("Key of the current session differs from the key at "
+                       "last login"));
         goto failure;
     }
 
@@ -1419,7 +1418,7 @@ esxVI_LookupObjectContentByType(esxVI_Context *ctx,
     esxVI_PropertyFilterSpec *propertyFilterSpec = NULL;
 
     if (ctx->fullTraversalSpecList == NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid call");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid call"));
         return -1;
     }
 
@@ -1495,8 +1494,8 @@ esxVI_GetManagedEntityStatus(esxVI_ObjectContent *objectContent,
     }
 
     ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                 "Missing '%s' property while looking for ManagedEntityStatus",
-                 propertyName);
+                 _("Missing '%s' property while looking for "
+                   "ManagedEntityStatus"), propertyName);
 
     return -1;
 }
@@ -1517,8 +1516,8 @@ esxVI_GetVirtualMachinePowerState(esxVI_ObjectContent *virtualMachine,
         }
     }
 
-    ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                 "Missing 'runtime.powerState' property");
+    ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                 _("Missing 'runtime.powerState' property"));
 
     return -1;
 }
@@ -1533,7 +1532,7 @@ esxVI_GetVirtualMachineQuestionInfo
     esxVI_DynamicProperty *dynamicProperty;
 
     if (questionInfo == NULL || *questionInfo != NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -1618,8 +1617,8 @@ esxVI_GetVirtualMachineIdentity(esxVI_ObjectContent *virtualMachine,
     esxVI_ManagedEntityStatus configStatus = esxVI_ManagedEntityStatus_Undefined;
 
     if (STRNEQ(virtualMachine->obj->type, "VirtualMachine")) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                     "ObjectContent does not reference a virtual machine");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                     _("ObjectContent does not reference a virtual machine"));
         return -1;
     }
 
@@ -1627,7 +1626,7 @@ esxVI_GetVirtualMachineIdentity(esxVI_ObjectContent *virtualMachine,
         if (esxUtil_ParseVirtualMachineIDString
               (virtualMachine->obj->value, id) < 0 || *id <= 0) {
             ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                         "Could not parse positive integer from '%s'",
+                         _("Could not parse positive integer from '%s'"),
                          virtualMachine->obj->value);
             goto failure;
         }
@@ -1635,7 +1634,7 @@ esxVI_GetVirtualMachineIdentity(esxVI_ObjectContent *virtualMachine,
 
     if (name != NULL) {
         if (*name != NULL) {
-            ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+            ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
             goto failure;
         }
 
@@ -1660,8 +1659,8 @@ esxVI_GetVirtualMachineIdentity(esxVI_ObjectContent *virtualMachine,
         }
 
         if (*name == NULL) {
-            ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                         "Could not get name of virtual machine");
+            ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                         _("Could not get name of virtual machine"));
             goto failure;
         }
     }
@@ -1688,14 +1687,14 @@ esxVI_GetVirtualMachineIdentity(esxVI_ObjectContent *virtualMachine,
             }
 
             if (uuid_string == NULL) {
-                ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                             "Could not get UUID of virtual machine");
+                ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                             _("Could not get UUID of virtual machine"));
                 goto failure;
             }
 
             if (virUUIDParse(uuid_string, uuid) < 0) {
                 ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                             "Could not parse UUID from string '%s'",
+                             _("Could not parse UUID from string '%s'"),
                              uuid_string);
                 goto failure;
             }
@@ -1731,7 +1730,7 @@ esxVI_LookupResourcePoolByHostSystem
     esxVI_ObjectContent *computeResource = NULL;
 
     if (resourcePool == NULL || *resourcePool != NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -1750,8 +1749,8 @@ esxVI_LookupResourcePoolByHostSystem
     }
 
     if (managedObjectReference == NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                     "Could not retrieve compute resource of host system");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                     _("Could not retrieve compute resource of host system"));
         goto failure;
     }
 
@@ -1764,8 +1763,8 @@ esxVI_LookupResourcePoolByHostSystem
     }
 
     if (computeResource == NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                     "Could not retrieve compute resource of host system");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                     _("Could not retrieve compute resource of host system"));
         goto failure;
     }
 
@@ -1784,8 +1783,8 @@ esxVI_LookupResourcePoolByHostSystem
     }
 
     if ((*resourcePool) == NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                     "Could not retrieve resource pool of compute resource");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                     _("Could not retrieve resource pool of compute resource"));
         goto failure;
     }
 
@@ -1813,7 +1812,7 @@ esxVI_LookupHostSystemByIp(esxVI_Context *ctx, const char *ipAddress,
     esxVI_ManagedObjectReference *managedObjectReference = NULL;
 
     if (hostSystem == NULL || *hostSystem != NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -1852,7 +1851,7 @@ esxVI_LookupVirtualMachineByUuid(esxVI_Context *ctx, const unsigned char *uuid,
     char uuid_string[VIR_UUID_STRING_BUFLEN] = "";
 
     if (virtualMachine == NULL || *virtualMachine != NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -1868,7 +1867,8 @@ esxVI_LookupVirtualMachineByUuid(esxVI_Context *ctx, const unsigned char *uuid,
             return 0;
         } else {
             ESX_VI_ERROR(VIR_ERR_NO_DOMAIN,
-                         "Could not find domain with UUID '%s'", uuid_string);
+                         _("Could not find domain with UUID '%s'"),
+                         uuid_string);
             goto failure;
         }
     }
@@ -1906,7 +1906,7 @@ esxVI_LookupVirtualMachineByName(esxVI_Context *ctx, const char *name,
     char *name_candidate = NULL;
 
     if (virtualMachine == NULL || *virtualMachine != NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -1945,7 +1945,7 @@ esxVI_LookupVirtualMachineByName(esxVI_Context *ctx, const char *name,
             return 0;
         } else {
             ESX_VI_ERROR(VIR_ERR_NO_DOMAIN,
-                         "Could not find domain with name '%s'", name);
+                         _("Could not find domain with name '%s'"), name);
             goto failure;
         }
     }
@@ -1998,8 +1998,8 @@ esxVI_LookupVirtualMachineByUuidAndPrepareForTask
     }
 
     if (pendingTaskInfoList != NULL) {
-        ESX_VI_ERROR(VIR_ERR_OPERATION_INVALID,
-                     "Other tasks are pending for this domain");
+        ESX_VI_ERROR(VIR_ERR_OPERATION_INVALID, "%s",
+                     _("Other tasks are pending for this domain"));
         goto failure;
     }
 
@@ -2034,7 +2034,7 @@ esxVI_LookupDatastoreByName(esxVI_Context *ctx, const char *name,
     int numInaccessibleDatastores = 0;
 
     if (datastore == NULL || *datastore != NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -2059,7 +2059,8 @@ esxVI_LookupDatastoreByName(esxVI_Context *ctx, const char *name,
         if (occurrence == esxVI_Occurrence_OptionalItem) {
             goto cleanup;
         } else {
-            ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "No datastores available");
+            ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                         _("No datastores available"));
             goto failure;
         }
     }
@@ -2083,9 +2084,9 @@ esxVI_LookupDatastoreByName(esxVI_Context *ctx, const char *name,
         }
 
         if (accessible == esxVI_Boolean_Undefined) {
-            ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                         "Got incomplete response while querying for the "
-                         "datastore 'summary.accessible' property");
+            ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                         _("Got incomplete response while querying for the "
+                           "datastore 'summary.accessible' property"));
             goto failure;
         }
 
@@ -2129,8 +2130,8 @@ esxVI_LookupDatastoreByName(esxVI_Context *ctx, const char *name,
                 if (! STRPREFIX(dynamicProperty->val->string,
                                 "/vmfs/volumes/")) {
                     ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                                 "Datastore URL '%s' has unexpected prefix, "
-                                 "expecting '/vmfs/volumes/' prefix",
+                                 _("Datastore URL '%s' has unexpected prefix, "
+                                   "expecting '/vmfs/volumes/' prefix"),
                                  dynamicProperty->val->string);
                     goto failure;
                 }
@@ -2153,11 +2154,11 @@ esxVI_LookupDatastoreByName(esxVI_Context *ctx, const char *name,
     if (occurrence != esxVI_Occurrence_OptionalItem) {
         if (numInaccessibleDatastores > 0) {
             ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                         "Could not find datastore '%s', maybe it's "
-                         "inaccessible", name);
+                         _("Could not find datastore '%s', maybe it's "
+                           "inaccessible"), name);
         } else {
             ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                         "Could not find datastore '%s'", name);
+                         _("Could not find datastore '%s'"), name);
         }
 
         goto failure;
@@ -2187,7 +2188,7 @@ int esxVI_LookupTaskInfoByTask(esxVI_Context *ctx,
     esxVI_DynamicProperty *dynamicProperty = NULL;
 
     if (taskInfo == NULL || *taskInfo != NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -2239,7 +2240,7 @@ esxVI_LookupPendingTaskInfoListByVirtualMachine
     esxVI_TaskInfo *taskInfo = NULL;
 
     if (pendingTaskInfoList == NULL || *pendingTaskInfoList != NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -2377,15 +2378,15 @@ esxVI_HandleVirtualMachineQuestion
     if (autoAnswer == esxVI_Boolean_True) {
         if (possibleAnswers == NULL) {
             ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                         "Pending question blocks virtual machine execution, "
-                         "question is '%s', no possible answers",
+                         _("Pending question blocks virtual machine execution, "
+                           "question is '%s', no possible answers"),
                          questionInfo->text);
             goto failure;
         } else if (answerChoice == NULL) {
             ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                         "Pending question blocks virtual machine execution, "
-                         "question is '%s', possible answers are %s, but no "
-                         "default answer is specified", questionInfo->text,
+                         _("Pending question blocks virtual machine execution, "
+                           "question is '%s', possible answers are %s, but no "
+                           "default answer is specified"), questionInfo->text,
                          possibleAnswers);
             goto failure;
         }
@@ -2402,13 +2403,13 @@ esxVI_HandleVirtualMachineQuestion
     } else {
         if (possibleAnswers != NULL) {
             ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                         "Pending question blocks virtual machine execution, "
-                         "question is '%s', possible answers are %s",
+                         _("Pending question blocks virtual machine execution, "
+                           "question is '%s', possible answers are %s"),
                          questionInfo->text, possibleAnswers);
         } else {
             ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                         "Pending question blocks virtual machine execution, "
-                         "question is '%s', no possible answers",
+                         _("Pending question blocks virtual machine execution, "
+                           "question is '%s', no possible answers"),
                          questionInfo->text);
         }
 
index 555dad5815412738ba857608249bb49c2e7da618..9b65e85ad86cde7963bcb88c2de46299ddda7e18 100644 (file)
 # include <curl/curl.h>
 
 # include "internal.h"
+# include "virterror_internal.h"
 # include "datatypes.h"
 # include "esx_vi_types.h"
 
+
+
+# define ESX_VI_ERROR(code, ...)                                              \
+    virReportErrorHelper(NULL, VIR_FROM_ESX, code, __FILE__, __FUNCTION__,    \
+                         __LINE__, __VA_ARGS__)
+
+
+
 typedef enum _esxVI_APIVersion esxVI_APIVersion;
 typedef enum _esxVI_ProductVersion esxVI_ProductVersion;
 typedef enum _esxVI_Occurrence esxVI_Occurrence;
index f1234aea723fc8f051ac5552d722cc06f7b9e777..3e095c70bfee16524c8abe1b963613b16857517e 100644 (file)
 #include "memory.h"
 #include "logging.h"
 #include "uuid.h"
-#include "virterror_internal.h"
 #include "esx_vi_methods.h"
 #include "esx_util.h"
 
 #define VIR_FROM_THIS VIR_FROM_ESX
 
-#define ESX_VI_ERROR(code, ...)                                               \
-    virReportErrorHelper(NULL, VIR_FROM_ESX, code, __FILE__,  __FUNCTION__,   \
-                         __LINE__, __VA_ARGS__)
+
 
 #define ESX_VI__SOAP__REQUEST_HEADER                                          \
     "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"                            \
@@ -46,6 +43,8 @@
       "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">"                       \
     "<soapenv:Body>"
 
+
+
 #define ESX_VI__SOAP__REQUEST_FOOTER                                          \
     "</soapenv:Body>"                                                         \
     "</soapenv:Envelope>"
 
 #define ESX_VI__METHOD__CHECK_SERVICE()                                       \
     if (ctx->service == NULL) {                                               \
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid call");                 \
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid call"));        \
         return -1;                                                            \
     }
 
 
 #define ESX_VI__METHOD__PARAMETER__CHECK_OUTPUT(_name)                        \
     if (_name == NULL || *_name != NULL) {                                    \
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");             \
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));    \
         return -1;                                                            \
     }
 
@@ -198,7 +197,7 @@ esxVI_RetrieveServiceContent(esxVI_Context *ctx,
     esxVI_Response *response = NULL;
 
     if (serviceContent == NULL || *serviceContent != NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -276,7 +275,7 @@ ESX_VI__METHOD(SessionIsActive,
     ESX_VI__METHOD__CHECK_SERVICE()
 
     if (active == NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 },
index 3a3071222ab506a1642e6fcc5043140eeebdd51f..a69ea447abb4a54bb04664725805207b3b4a47e3 100644 (file)
 #include "memory.h"
 #include "logging.h"
 #include "util.h"
-#include "virterror_internal.h"
 #include "esx_vi.h"
 #include "esx_vi_types.h"
 
 #define VIR_FROM_THIS VIR_FROM_ESX
 
-#define ESX_VI_ERROR(code, ...)                                               \
-    virReportErrorHelper(NULL, VIR_FROM_ESX, code, __FILE__, __FUNCTION__,    \
-                         __LINE__, __VA_ARGS__)
-
 
 
 #define ESV_VI__XML_TAG__OPEN(_buffer, _element, _type)                       \
     esxVI_##_type##_DeepCopy(esxVI_##_type **dest, esxVI_##_type *src)        \
     {                                                                         \
         if (dest == NULL || *dest != NULL) {                                  \
-            ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");         \
+            ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",                        \
+                         _("Invalid argument"));                              \
             return -1;                                                        \
         }                                                                     \
                                                                               \
                                     esxVI_##_type **ptrptr)                   \
     {                                                                         \
         if (anyType == NULL || ptrptr == NULL || *ptrptr != NULL) {           \
-            ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");         \
+            ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",                        \
+                         _("Invalid argument"));                              \
             return -1;                                                        \
         }                                                                     \
                                                                               \
                               const char *element, virBufferPtr output)       \
     {                                                                         \
         if (element == NULL || output == NULL ) {                             \
-            ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");         \
+            ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",                        \
+                         _("Invalid argument"));                              \
             return -1;                                                        \
         }                                                                     \
                                                                               \
         xmlNodePtr childNode = NULL;                                          \
                                                                               \
         if (ptrptr == NULL || *ptrptr != NULL) {                              \
-            ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");         \
+            ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",                        \
+                         _("Invalid argument"));                              \
             return -1;                                                        \
         }                                                                     \
                                                                               \
         long long value;                                                      \
                                                                               \
         if (number == NULL || *number != NULL) {                              \
-            ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");         \
+            ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",                        \
+                         _("Invalid argument"));                              \
             return -1;                                                        \
         }                                                                     \
                                                                               \
     esxVI_##__type##_DynamicCast(void *item)                                  \
     {                                                                         \
         if (item == NULL) {                                                   \
-            ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");         \
+            ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",                        \
+                         _("Invalid argument"));                              \
             return NULL;                                                      \
         }                                                                     \
                                                                               \
@@ -709,7 +710,7 @@ esxVI_AnyType_ExpectType(esxVI_AnyType *anyType, esxVI_Type type)
 {
     if (anyType->type != type) {
         ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                     "Expecting type '%s' but found '%s'",
+                     _("Expecting type '%s' but found '%s'"),
                      esxVI_Type_ToString(type),
                      anyType->type != esxVI_Type_Other
                        ? esxVI_Type_ToString(anyType->type)
@@ -724,7 +725,7 @@ int
 esxVI_AnyType_DeepCopy(esxVI_AnyType **dest, esxVI_AnyType *src)
 {
     if (dest == NULL || *dest != NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -740,7 +741,8 @@ esxVI_AnyType_DeepCopy(esxVI_AnyType **dest, esxVI_AnyType *src)
     (*dest)->node = xmlCopyNode(src->node, 1);
 
     if ((*dest)->node == NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Could not copy an XML node");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                     _("Could not copy an XML node"));
         goto failure;
     }
 
@@ -790,7 +792,7 @@ esxVI_AnyType_Deserialize(xmlNodePtr node, esxVI_AnyType **anyType)
     long long int number;
 
     if (anyType == NULL || *anyType != NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -801,7 +803,8 @@ esxVI_AnyType_Deserialize(xmlNodePtr node, esxVI_AnyType **anyType)
     (*anyType)->node = xmlCopyNode(node, 1);
 
     if ((*anyType)->node == NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Could not copy an XML node");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                     _("Could not copy an XML node"));
         goto failure;
     }
 
@@ -811,8 +814,8 @@ esxVI_AnyType_Deserialize(xmlNodePtr node, esxVI_AnyType **anyType)
                  BAD_CAST "http://www.w3.org/2001/XMLSchema-instance");
 
     if ((*anyType)->other == NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                     "AnyType is missing 'type' property");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                     _("AnyType is missing 'type' property"));
         goto failure;
     }
 
@@ -820,7 +823,7 @@ esxVI_AnyType_Deserialize(xmlNodePtr node, esxVI_AnyType **anyType)
 
     if ((*anyType)->type == esxVI_Type_Undefined) {
         ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                     "Unknown value '%s' for AnyType 'type' property",
+                     _("Unknown value '%s' for AnyType 'type' property"),
                      (*anyType)->other);
         goto failure;
     }
@@ -837,19 +840,19 @@ esxVI_AnyType_Deserialize(xmlNodePtr node, esxVI_AnyType **anyType)
         }
     }
 
-#define _DESERIALIZE_NUMBER(_type, _xsdType, _name, _min, _max)           \
+#define _DESERIALIZE_NUMBER(_type, _xsdType, _name, _min, _max)               \
         do {                                                                  \
             if (virStrToLong_ll((*anyType)->value, NULL, 10, &number) < 0) {  \
                 ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,                          \
-                             "Unknown value '%s' for "_xsdType,               \
-                             (*anyType)->value);                              \
+                             _("Unknown value '%s' for %s"),                  \
+                             (*anyType)->value, _xsdType);                    \
                 goto failure;                                                 \
             }                                                                 \
                                                                               \
             if (number < (_min) || number > (_max)) {                         \
                 ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,                          \
-                             "Value '%s' is out of "_xsdType" range",         \
-                             (*anyType)->value);                              \
+                             _("Value '%s' is out of %s range"),              \
+                             (*anyType)->value, _xsdType);                    \
                 goto failure;                                                 \
             }                                                                 \
                                                                               \
@@ -864,7 +867,7 @@ esxVI_AnyType_Deserialize(xmlNodePtr node, esxVI_AnyType **anyType)
             (*anyType)->boolean = esxVI_Boolean_False;
         } else {
             ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                         "Unknown value '%s' for xsd:boolean",
+                         _("Unknown value '%s' for xsd:boolean"),
                          (*anyType)->value);
             goto failure;
         }
@@ -995,7 +998,7 @@ int
 esxVI_String_DeepCopyValue(char **dest, const char *src)
 {
     if (dest == NULL || *dest != NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -1029,7 +1032,7 @@ esxVI_String_SerializeValue(const char *value, const char *element,
                             virBufferPtr output)
 {
     if (element == NULL || output == NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -1059,7 +1062,7 @@ int
 esxVI_String_DeserializeValue(xmlNodePtr node, char **value)
 {
     if (value == NULL || *value != NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -1184,7 +1187,7 @@ int
 esxVI_DateTime_Deserialize(xmlNodePtr node, esxVI_DateTime **dateTime)
 {
     if (dateTime == NULL || *dateTime != NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -1196,9 +1199,9 @@ esxVI_DateTime_Deserialize(xmlNodePtr node, esxVI_DateTime **dateTime)
       (char *)xmlNodeListGetString(node->doc, node->children, 1);
 
     if ((*dateTime)->value == NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                     "XML node doesn't contain text, expecting an "
-                     "xsd:dateTime value");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                     _("XML node doesn't contain text, expecting an "
+                       "xsd:dateTime value"));
         goto failure;
     }
 
@@ -1281,7 +1284,7 @@ esxVI_ManagedObjectReference_Serialize
    const char *element, virBufferPtr output)
 {
     if (element == NULL || output == NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -1311,7 +1314,7 @@ esxVI_ManagedObjectReference_Deserialize
   (xmlNodePtr node, esxVI_ManagedObjectReference **managedObjectReference)
 {
     if (managedObjectReference == NULL || *managedObjectReference != NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -1323,8 +1326,8 @@ esxVI_ManagedObjectReference_Deserialize
       (char *)xmlGetNoNsProp(node, BAD_CAST "type");
 
     if ((*managedObjectReference)->type == NULL) {
-        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
-                     "ManagedObjectReference is missing 'type' property");
+        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                     _("ManagedObjectReference is missing 'type' property"));
         goto failure;
     }
 
index c6a92bf790a068ffb691705a884f139e152c6599..d242fc672c090d9a8015882df4902c0b85f3756b 100644 (file)
@@ -27,6 +27,7 @@
 #include "virterror_internal.h"
 #include "memory.h"
 #include "logging.h"
+#include "esx_private.h"
 #include "esx_util.h"
 #include "esx_vmx.h"
 
@@ -421,12 +422,6 @@ def->parallels[0]...
 
 #define VIR_FROM_THIS VIR_FROM_ESX
 
-#define ESX_ERROR(code, ...)                                                  \
-    virReportErrorHelper(NULL, VIR_FROM_ESX, code, __FILE__, __FUNCTION__,    \
-                         __LINE__, __VA_ARGS__)
-
-
-
 #define ESX_BUILD_VMX_NAME(_suffix)                                           \
     snprintf(_suffix##_name, sizeof(_suffix##_name), "%s."#_suffix, prefix);
 
@@ -438,9 +433,9 @@ esxVMX_SCSIDiskNameToControllerAndID(const char *name, int *controller, int *id)
     int idx;
 
     if (! STRPREFIX(name, "sd")) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Expecting domain XML attribute 'dev' of entry "
-                  "'devices/disk/target' to start with 'sd'");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                  _("Expecting domain XML attribute 'dev' of entry "
+                    "'devices/disk/target' to start with 'sd'"));
         return -1;
     }
 
@@ -448,14 +443,14 @@ esxVMX_SCSIDiskNameToControllerAndID(const char *name, int *controller, int *id)
 
     if (idx < 0) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Could not parse valid disk index from '%s'", name);
+                  _("Could not parse valid disk index from '%s'"), name);
         return -1;
     }
 
     /* Each of the 4 SCSI controllers offers 15 IDs for devices */
     if (idx >= (4 * 15)) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "SCSI disk index (parsed from '%s') is too large", name);
+                  _("SCSI disk index (parsed from '%s') is too large"), name);
         return -1;
     }
 
@@ -478,9 +473,9 @@ esxVMX_IDEDiskNameToControllerAndID(const char *name, int *controller, int *id)
     int idx;
 
     if (! STRPREFIX(name, "hd")) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Expecting domain XML attribute 'dev' of entry "
-                  "'devices/disk/target' to start with 'hd'");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                  _("Expecting domain XML attribute 'dev' of entry "
+                    "'devices/disk/target' to start with 'hd'"));
         return -1;
     }
 
@@ -488,14 +483,14 @@ esxVMX_IDEDiskNameToControllerAndID(const char *name, int *controller, int *id)
 
     if (idx < 0) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Could not parse valid disk index from '%s'", name);
+                  _("Could not parse valid disk index from '%s'"), name);
         return -1;
     }
 
     /* Each of the 2 IDE controllers offers 2 IDs for devices */
     if (idx >= (2 * 2)) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "IDE disk index (parsed from '%s') is too large", name);
+                  _("IDE disk index (parsed from '%s') is too large"), name);
         return -1;
     }
 
@@ -513,9 +508,9 @@ esxVMX_FloppyDiskNameToController(const char *name, int *controller)
     int idx;
 
     if (! STRPREFIX(name, "fd")) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Expecting domain XML attribute 'dev' of entry "
-                  "'devices/disk/target' to start with 'fd'");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                  _("Expecting domain XML attribute 'dev' of entry "
+                    "'devices/disk/target' to start with 'fd'"));
         return -1;
     }
 
@@ -523,13 +518,13 @@ esxVMX_FloppyDiskNameToController(const char *name, int *controller)
 
     if (idx < 0) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Could not parse valid disk index from '%s'", name);
+                  _("Could not parse valid disk index from '%s'"), name);
         return -1;
     }
 
     if (idx >= 2) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Floppy disk index (parsed from '%s') is too large", name);
+                  _("Floppy disk index (parsed from '%s') is too large"), name);
         return -1;
     }
 
@@ -559,8 +554,8 @@ esxVMX_GatherSCSIControllers(virDomainDefPtr def, char *virtualDev[4],
             STRCASENEQ(disk->driverName, "buslogic") &&
             STRCASENEQ(disk->driverName, "lsilogic")) {
             ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "Expecting domain XML entry 'devices/disk/target' to be "
-                      "'buslogic' or 'lsilogic' but found '%s'",
+                      _("Expecting domain XML entry 'devices/disk/target' to "
+                        "be 'buslogic' or 'lsilogic' but found '%s'"),
                       disk->driverName);
             return -1;
         }
@@ -576,8 +571,8 @@ esxVMX_GatherSCSIControllers(virDomainDefPtr def, char *virtualDev[4],
             virtualDev[controller] = disk->driverName;
         } else if (STRCASENEQ(virtualDev[controller], disk->driverName)) {
             ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "Inconsistent driver usage ('%s' is not '%s') on SCSI "
-                      "controller index %d", virtualDev[controller],
+                      _("Inconsistent driver usage ('%s' is not '%s') on SCSI "
+                        "controller index %d"), virtualDev[controller],
                       disk->driverName, controller);
             return -1;
         }
@@ -602,8 +597,8 @@ esxVMX_AbsolutePathToDatastoreRelatedPath(esxVI_Context *ctx,
     if (sscanf(absolutePath, "/vmfs/volumes/%a[^/]/%a[^\n]",
                &preliminaryDatastoreName, &directoryAndFileName) != 2) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Absolute path '%s' doesn't have expected format "
-                  "'/vmfs/volumes/<datastore>/<path>'", absolutePath);
+                  _("Absolute path '%s' doesn't have expected format "
+                    "'/vmfs/volumes/<datastore>/<path>'"), absolutePath);
         goto failure;
     }
 
@@ -697,8 +692,8 @@ esxVMX_ParseFileName(esxVI_Context *ctx, const char *fileName,
     } else if (strchr(fileName, '/') != NULL) {
         /* Found relative path, this is not supported */
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Found relative path '%s' in VMX file, this is not "
-                  "supported", fileName);
+                  _("Found relative path '%s' in VMX file, this is not "
+                    "supported"), fileName);
         return NULL;
     } else {
         /* Found single file name referencing a file inside a datastore */
@@ -758,8 +753,8 @@ esxVMX_ParseConfig(esxVI_Context *ctx, const char *vmx,
 
     if (config_version != 8) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Expecting VMX entry 'config.version' to be 8 but found "
-                  "%lld", config_version);
+                  _("Expecting VMX entry 'config.version' to be 8 but found "
+                    "%lld"), config_version);
         goto failure;
     }
 
@@ -773,8 +768,9 @@ esxVMX_ParseConfig(esxVI_Context *ctx, const char *vmx,
       case esxVI_APIVersion_25:
         if (virtualHW_version != 4) {
             ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "Expecting VMX entry 'virtualHW.version' to be 4 for "
-                      "VI API version 2.5 but found %lld", virtualHW_version);
+                      _("Expecting VMX entry 'virtualHW.version' to be 4 for "
+                        "VI API version 2.5 but found %lld"),
+                      virtualHW_version);
             goto failure;
         }
 
@@ -783,8 +779,9 @@ esxVMX_ParseConfig(esxVI_Context *ctx, const char *vmx,
       case esxVI_APIVersion_40:
         if (virtualHW_version != 4 && virtualHW_version != 7) {
             ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "Expecting VMX entry 'virtualHW.version' to be 4 or 7 for "
-                      "VI API version 4.0 but found %lld", virtualHW_version);
+                      _("Expecting VMX entry 'virtualHW.version' to be 4 or 7 "
+                        "for VI API version 4.0 but found %lld"),
+                      virtualHW_version);
             goto failure;
         }
 
@@ -793,16 +790,16 @@ esxVMX_ParseConfig(esxVI_Context *ctx, const char *vmx,
       case esxVI_APIVersion_Unknown:
         if (virtualHW_version != 4 && virtualHW_version != 7) {
             ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "Expecting VMX entry 'virtualHW.version' to be 4 or 7 "
-                      "but found %lld", virtualHW_version);
+                      _("Expecting VMX entry 'virtualHW.version' to be 4 or 7 "
+                        "but found %lld"), virtualHW_version);
             goto failure;
         }
 
         break;
 
       default:
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Expecting VI API version 2.5 or 4.0");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                  _("Expecting VI API version 2.5 or 4.0"));
         goto failure;
     }
 
@@ -824,8 +821,8 @@ esxVMX_ParseConfig(esxVI_Context *ctx, const char *vmx,
 
     if (memsize <= 0 || memsize % 4 != 0) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Expecting VMX entry 'memsize' to be an unsigned "
-                  "integer (multiple of 4) but found %lld", memsize);
+                  _("Expecting VMX entry 'memsize' to be an unsigned "
+                    "integer (multiple of 4) but found %lld"), memsize);
         goto failure;
     }
 
@@ -853,8 +850,8 @@ esxVMX_ParseConfig(esxVI_Context *ctx, const char *vmx,
 
     if (numvcpus <= 0 || (numvcpus % 2 != 0 && numvcpus != 1)) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Expecting VMX entry 'numvcpus' to be an unsigned "
-                  "integer (1 or a multiple of 2) but found %lld", numvcpus);
+                  _("Expecting VMX entry 'numvcpus' to be an unsigned "
+                    "integer (1 or a multiple of 2) but found %lld"), numvcpus);
         goto failure;
     }
 
@@ -885,16 +882,16 @@ esxVMX_ParseConfig(esxVI_Context *ctx, const char *vmx,
 
             if (number < 0) {
                 ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                          "Expecting VMX entry 'sched.cpu.affinity' to be "
-                          "a comma separated list of unsigned integers but "
-                          "found '%s'", sched_cpu_affinity);
+                          _("Expecting VMX entry 'sched.cpu.affinity' to be "
+                            "a comma separated list of unsigned integers but "
+                            "found '%s'"), sched_cpu_affinity);
                 goto failure;
             }
 
             if (number >= VIR_DOMAIN_CPUMASK_LEN) {
                 ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                          "VMX entry 'sched.cpu.affinity' contains a %d, this "
-                          "value is too large", number);
+                          _("VMX entry 'sched.cpu.affinity' contains a %d, "
+                            "this value is too large"), number);
                 goto failure;
             }
 
@@ -913,9 +910,9 @@ esxVMX_ParseConfig(esxVI_Context *ctx, const char *vmx,
                 break;
             } else {
                 ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                          "Expecting VMX entry 'sched.cpu.affinity' to be "
-                          "a comma separated list of unsigned integers but "
-                          "found '%s'", sched_cpu_affinity);
+                          _("Expecting VMX entry 'sched.cpu.affinity' to be "
+                            "a comma separated list of unsigned integers but "
+                            "found '%s'"), sched_cpu_affinity);
                 goto failure;
             }
 
@@ -924,9 +921,9 @@ esxVMX_ParseConfig(esxVI_Context *ctx, const char *vmx,
 
         if (count < numvcpus) {
             ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "Expecting VMX entry 'sched.cpu.affinity' to contain "
-                      "at least as many values as 'numvcpus' (%lld) but "
-                      "found only %d value(s)", numvcpus, count);
+                      _("Expecting VMX entry 'sched.cpu.affinity' to contain "
+                        "at least as many values as 'numvcpus' (%lld) but "
+                        "found only %d value(s)"), numvcpus, count);
             goto failure;
         }
     }
@@ -1175,7 +1172,7 @@ esxVMX_ParseVNC(virConfPtr conf, virDomainGraphicsDefPtr *def)
     long long port = 0;
 
     if (def == NULL || *def != NULL) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -1240,13 +1237,13 @@ esxVMX_ParseSCSIController(virConfPtr conf, int controller, int *present,
     char virtualDev_name[32];
 
     if (virtualDev == NULL || *virtualDev != NULL) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
     if (controller < 0 || controller > 3) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "SCSI controller index %d out of [0..3] range",
+                  _("SCSI controller index %d out of [0..3] range"),
                   controller);
         return -1;
     }
@@ -1271,8 +1268,8 @@ esxVMX_ParseSCSIController(virConfPtr conf, int controller, int *present,
         STRCASENEQ(*virtualDev, "buslogic") &&
         STRCASENEQ(*virtualDev, "lsilogic")) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Expecting VMX entry '%s' to be 'buslogic' or 'lsilogic' "
-                  "but found '%s'", virtualDev_name, *virtualDev);
+                  _("Expecting VMX entry '%s' to be 'buslogic' or 'lsilogic' "
+                    "but found '%s'"), virtualDev_name, *virtualDev);
         goto failure;
     }
 
@@ -1352,7 +1349,7 @@ esxVMX_ParseDisk(esxVI_Context *ctx, virConfPtr conf, int device, int bus,
     int writeThrough = 0;
 
     if (def == NULL || *def != NULL) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -1370,14 +1367,14 @@ esxVMX_ParseDisk(esxVI_Context *ctx, virConfPtr conf, int device, int bus,
         if (bus == VIR_DOMAIN_DISK_BUS_SCSI) {
             if (controller < 0 || controller > 3) {
                 ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                          "SCSI controller index %d out of [0..3] range",
+                          _("SCSI controller index %d out of [0..3] range"),
                           controller);
                 goto failure;
             }
 
             if (id < 0 || id > 15 || id == 7) {
                 ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                          "SCSI ID %d out of [0..6,8..15] range", id);
+                          _("SCSI ID %d out of [0..6,8..15] range"), id);
                 goto failure;
             }
 
@@ -1405,14 +1402,14 @@ esxVMX_ParseDisk(esxVI_Context *ctx, virConfPtr conf, int device, int bus,
         } else if (bus == VIR_DOMAIN_DISK_BUS_IDE) {
             if (controller < 0 || controller > 1) {
                 ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                          "IDE controller index %d out of [0..1] range",
+                          _("IDE controller index %d out of [0..1] range"),
                           controller);
                 goto failure;
             }
 
             if (id < 0 || id > 1) {
                 ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                          "IDE ID %d out of [0..1] range", id);
+                          _("IDE ID %d out of [0..1] range"), id);
                 goto failure;
             }
 
@@ -1428,7 +1425,7 @@ esxVMX_ParseDisk(esxVI_Context *ctx, virConfPtr conf, int device, int bus,
             }
         } else {
             ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "Unsupported bus type '%s' for device type '%s'",
+                      _("Unsupported bus type '%s' for device type '%s'"),
                       virDomainDiskBusTypeToString(bus),
                       virDomainDiskDeviceTypeToString(device));
             goto failure;
@@ -1437,7 +1434,7 @@ esxVMX_ParseDisk(esxVI_Context *ctx, virConfPtr conf, int device, int bus,
         if (bus == VIR_DOMAIN_DISK_BUS_FDC) {
             if (controller < 0 || controller > 1) {
                 ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                          "Floppy controller index %d out of [0..1] range",
+                          _("Floppy controller index %d out of [0..1] range"),
                           controller);
                 goto failure;
             }
@@ -1454,14 +1451,14 @@ esxVMX_ParseDisk(esxVI_Context *ctx, virConfPtr conf, int device, int bus,
             }
         } else {
             ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "Unsupported bus type '%s' for device type '%s'",
+                      _("Unsupported bus type '%s' for device type '%s'"),
                       virDomainDiskBusTypeToString(bus),
                       virDomainDiskDeviceTypeToString(device));
             goto failure;
         }
     } else {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Unsupported device type '%s'",
+                  _("Unsupported device type '%s'"),
                   virDomainDiskDeviceTypeToString(device));
         goto failure;
     }
@@ -1532,14 +1529,14 @@ esxVMX_ParseDisk(esxVI_Context *ctx, virConfPtr conf, int device, int bus,
                 if (bus == VIR_DOMAIN_DISK_BUS_SCSI &&
                     STRCASENEQ(deviceType, "scsi-hardDisk")) {
                     ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                              "Expecting VMX entry '%s' to be 'scsi-hardDisk' "
-                              "but found '%s'", deviceType_name, deviceType);
+                              _("Expecting VMX entry '%s' to be 'scsi-hardDisk' "
+                                "but found '%s'"), deviceType_name, deviceType);
                     goto failure;
                 } else if (bus == VIR_DOMAIN_DISK_BUS_IDE &&
                            STRCASENEQ(deviceType, "ata-hardDisk")) {
                     ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                              "Expecting VMX entry '%s' to be 'ata-hardDisk' "
-                              "but found '%s'", deviceType_name, deviceType);
+                              _("Expecting VMX entry '%s' to be 'ata-hardDisk' "
+                                "but found '%s'"), deviceType_name, deviceType);
                     goto failure;
                 }
             }
@@ -1574,8 +1571,8 @@ esxVMX_ParseDisk(esxVI_Context *ctx, virConfPtr conf, int device, int bus,
             goto ignore;
         } else {
             ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "Invalid or not yet handled value '%s' for VMX entry "
-                      "'%s'", fileName, fileName_name);
+                      _("Invalid or not yet handled value '%s' for VMX entry "
+                        "'%s'"), fileName, fileName_name);
             goto failure;
         }
     } else if (device == VIR_DOMAIN_DISK_DEVICE_CDROM) {
@@ -1583,8 +1580,8 @@ esxVMX_ParseDisk(esxVI_Context *ctx, virConfPtr conf, int device, int bus,
             if (deviceType != NULL) {
                 if (STRCASENEQ(deviceType, "cdrom-image")) {
                     ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                              "Expecting VMX entry '%s' to be 'cdrom-image' "
-                              "but found '%s'", deviceType_name, deviceType);
+                              _("Expecting VMX entry '%s' to be 'cdrom-image' "
+                                "but found '%s'"), deviceType_name, deviceType);
                     goto failure;
                 }
             }
@@ -1611,8 +1608,8 @@ esxVMX_ParseDisk(esxVI_Context *ctx, virConfPtr conf, int device, int bus,
             fileName = NULL;
         } else {
             ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "Invalid or not yet handled value '%s' for VMX entry "
-                      "'%s'", fileName, fileName_name);
+                      _("Invalid or not yet handled value '%s' for VMX entry "
+                        "'%s'"), fileName, fileName_name);
             goto failure;
         }
     } else if (device == VIR_DOMAIN_DISK_DEVICE_FLOPPY) {
@@ -1620,8 +1617,8 @@ esxVMX_ParseDisk(esxVI_Context *ctx, virConfPtr conf, int device, int bus,
             if (fileType != NULL) {
                 if (STRCASENEQ(fileType, "file")) {
                     ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                              "Expecting VMX entry '%s' to be 'file' but "
-                              "found '%s'", fileType_name, fileType);
+                              _("Expecting VMX entry '%s' to be 'file' but "
+                                "found '%s'"), fileType_name, fileType);
                     goto failure;
                 }
             }
@@ -1640,12 +1637,12 @@ esxVMX_ParseDisk(esxVI_Context *ctx, virConfPtr conf, int device, int bus,
             fileName = NULL;
         } else {
             ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "Invalid or not yet handled value '%s' for VMX entry "
-                      "'%s'", fileName, fileName_name);
+                      _("Invalid or not yet handled value '%s' for VMX entry "
+                        "'%s'"), fileName, fileName_name);
             goto failure;
         }
     } else {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "Unsupported device type '%s'",
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, _("Unsupported device type '%s'"),
                   virDomainDiskDeviceTypeToString(device));
         goto failure;
     }
@@ -1704,13 +1701,13 @@ esxVMX_ParseEthernet(virConfPtr conf, int controller, virDomainNetDefPtr *def)
     char *networkName = NULL;
 
     if (def == NULL || *def != NULL) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
     if (controller < 0 || controller > 3) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Ethernet controller index %d out of [0..3] range",
+                  _("Ethernet controller index %d out of [0..3] range"),
                   controller);
         return -1;
     }
@@ -1767,8 +1764,8 @@ esxVMX_ParseEthernet(virConfPtr conf, int controller, virDomainNetDefPtr *def)
         if (generatedAddress != NULL) {
             if (virParseMacAddr(generatedAddress, (*def)->mac) < 0) {
                 ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                          "Expecting VMX entry '%s' to be MAC address but "
-                          "found '%s'", generatedAddress_name,
+                          _("Expecting VMX entry '%s' to be MAC address but "
+                            "found '%s'"), generatedAddress_name,
                           generatedAddress);
                 goto failure;
             }
@@ -1777,15 +1774,15 @@ esxVMX_ParseEthernet(virConfPtr conf, int controller, virDomainNetDefPtr *def)
         if (address != NULL) {
             if (virParseMacAddr(address, (*def)->mac) < 0) {
                 ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                          "Expecting VMX entry '%s' to be MAC address but "
-                          "found '%s'", address_name, address);
+                          _("Expecting VMX entry '%s' to be MAC address but "
+                            "found '%s'"), address_name, address);
                 goto failure;
             }
         }
     } else {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Expecting VMX entry '%s' to be 'generated' or 'static' or "
-                  "'vpx' but found '%s'", addressType_name, addressType);
+                  _("Expecting VMX entry '%s' to be 'generated' or 'static' or "
+                    "'vpx' but found '%s'"), addressType_name, addressType);
         goto failure;
     }
 
@@ -1800,8 +1797,8 @@ esxVMX_ParseEthernet(virConfPtr conf, int controller, virDomainNetDefPtr *def)
         STRCASENEQ(virtualDev, "vmxnet3") &&
         STRCASENEQ(virtualDev, "e1000")) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Expecting VMX entry '%s' to be 'vlance' or 'vmxnet' or "
-                  "'vmxnet3' or 'e1000' but found '%s'", virtualDev_name,
+                  _("Expecting VMX entry '%s' to be 'vlance' or 'vmxnet' or "
+                    "'vmxnet3' or 'e1000' but found '%s'"), virtualDev_name,
                   virtualDev);
         goto failure;
     }
@@ -1831,13 +1828,13 @@ esxVMX_ParseEthernet(virConfPtr conf, int controller, virDomainNetDefPtr *def)
     } else if (STRCASEEQ(connectionType, "hostonly")) {
         /* FIXME */
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "No yet handled value '%s' for VMX entry '%s'",
+                  _("No yet handled value '%s' for VMX entry '%s'"),
                   connectionType, connectionType_name);
         goto failure;
     } else if (STRCASEEQ(connectionType, "nat")) {
         /* FIXME */
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "No yet handled value '%s' for VMX entry '%s'",
+                  _("No yet handled value '%s' for VMX entry '%s'"),
                   connectionType, connectionType_name);
         goto failure;
     } else if (STRCASEEQ(connectionType, "custom")) {
@@ -1851,7 +1848,7 @@ esxVMX_ParseEthernet(virConfPtr conf, int controller, virDomainNetDefPtr *def)
         vnet = NULL;
     } else {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Invalid value '%s' for VMX entry '%s'", connectionType,
+                  _("Invalid value '%s' for VMX entry '%s'"), connectionType,
                   connectionType_name);
         goto failure;
     }
@@ -1899,13 +1896,13 @@ esxVMX_ParseSerial(esxVI_Context *ctx, virConfPtr conf, int port,
     char *fileName = NULL;
 
     if (def == NULL || *def != NULL) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
     if (port < 0 || port > 3) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Serial port index %d out of [0..3] range", port);
+                  _("Serial port index %d out of [0..3] range"), port);
         return -1;
     }
 
@@ -1978,8 +1975,8 @@ esxVMX_ParseSerial(esxVI_Context *ctx, virConfPtr conf, int port,
         fileName = NULL;
     } else {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Expecting VMX entry '%s' to be 'device', 'file' or 'pipe' "
-                  "but found '%s'", fileType_name, fileType);
+                  _("Expecting VMX entry '%s' to be 'device', 'file' or 'pipe' "
+                    "but found '%s'"), fileType_name, fileType);
         goto failure;
     }
 
@@ -2022,13 +2019,13 @@ esxVMX_ParseParallel(esxVI_Context *ctx, virConfPtr conf, int port,
     char *fileName = NULL;
 
     if (def == NULL || *def != NULL) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
     if (port < 0 || port > 2) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Parallel port index %d out of [0..2] range", port);
+                  _("Parallel port index %d out of [0..2] range"), port);
         return -1;
     }
 
@@ -2091,8 +2088,8 @@ esxVMX_ParseParallel(esxVI_Context *ctx, virConfPtr conf, int port,
         }
     } else {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Expecting VMX entry '%s' to be 'device' or 'file' but "
-                  "found '%s'", fileType_name, fileType);
+                  _("Expecting VMX entry '%s' to be 'device' or 'file' but "
+                    "found '%s'"), fileType_name, fileType);
         goto failure;
     }
 
@@ -2157,8 +2154,8 @@ esxVMX_FormatFileName(esxVI_Context *ctx ATTRIBUTE_UNUSED, const char *src)
     } else {
         /* Found relative path, this is not supported */
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Found relative path '%s' in domain XML, this is not "
-                  "supported", src);
+                  _("Found relative path '%s' in domain XML, this is not "
+                    "supported"), src);
         goto failure;
     }
 
@@ -2192,7 +2189,7 @@ esxVMX_FormatConfig(esxVI_Context *ctx, virDomainDefPtr def,
 
     if (def->virtType != VIR_DOMAIN_VIRT_VMWARE) { /* FIXME: maybe add VIR_DOMAIN_VIRT_ESX ? */
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Expecting virt type to be '%s' but found '%s'",
+                  _("Expecting virt type to be '%s' but found '%s'"),
                   virDomainVirtTypeToString(VIR_DOMAIN_VIRT_VMWARE),
                   virDomainVirtTypeToString(def->virtType));
         return NULL;
@@ -2212,8 +2209,8 @@ esxVMX_FormatConfig(esxVI_Context *ctx, virDomainDefPtr def,
         break;
 
       default:
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Expecting VI API version 2.5 or 4.0");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                  _("Expecting VI API version 2.5 or 4.0"));
         goto failure;
     }
 
@@ -2224,8 +2221,8 @@ esxVMX_FormatConfig(esxVI_Context *ctx, virDomainDefPtr def,
         virBufferAddLit(&buffer, "guestOS = \"other-64\"\n");
     } else {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Expecting domain XML attribute 'arch' of entry 'os/type' "
-                  "to be 'i686' or 'x86_64' but found '%s'", def->os.arch);
+                  _("Expecting domain XML attribute 'arch' of entry 'os/type' "
+                    "to be 'i686' or 'x86_64' but found '%s'"), def->os.arch);
         goto failure;
     }
 
@@ -2248,8 +2245,8 @@ esxVMX_FormatConfig(esxVI_Context *ctx, virDomainDefPtr def,
     /* def:maxmem -> vmx:memsize */
     if (def->maxmem <= 0 || def->maxmem % 4096 != 0) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Expecting domain XML entry 'memory' to be an unsigned "
-                  "integer (multiple of 4096) but found %lld",
+                  _("Expecting domain XML entry 'memory' to be an unsigned "
+                    "integer (multiple of 4096) but found %lld"),
                   (unsigned long long)def->maxmem);
         goto failure;
     }
@@ -2262,8 +2259,8 @@ esxVMX_FormatConfig(esxVI_Context *ctx, virDomainDefPtr def,
     if (def->memory < def->maxmem) {
         if (def->memory <= 0 || def->memory % 1024 != 0) {
             ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "Expecting domain XML entry 'currentMemory' to be an "
-                      "unsigned integer (multiple of 1024) but found %lld",
+                      _("Expecting domain XML entry 'currentMemory' to be an "
+                        "unsigned integer (multiple of 1024) but found %lld"),
                       (unsigned long long)def->memory);
             goto failure;
         }
@@ -2276,8 +2273,8 @@ esxVMX_FormatConfig(esxVI_Context *ctx, virDomainDefPtr def,
     /* def:vcpus -> vmx:numvcpus */
     if (def->vcpus <= 0 || (def->vcpus % 2 != 0 && def->vcpus != 1)) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Expecting domain XML entry 'vcpu' to be an unsigned "
-                  "integer (1 or a multiple of 2) but found %d",
+                  _("Expecting domain XML entry 'vcpu' to be an unsigned "
+                    "integer (1 or a multiple of 2) but found %d"),
                   (int)def->vcpus);
         goto failure;
     }
@@ -2298,8 +2295,8 @@ esxVMX_FormatConfig(esxVI_Context *ctx, virDomainDefPtr def,
 
         if (sched_cpu_affinity_length < def->vcpus) {
             ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "Expecting domain XML attribute 'cpuset' of entry "
-                      "'vcpu' to contains at least %d CPU(s)",
+                      _("Expecting domain XML attribute 'cpuset' of entry "
+                        "'vcpu' to contains at least %d CPU(s)"),
                       (int)def->vcpus);
             goto failure;
         }
@@ -2331,7 +2328,7 @@ esxVMX_FormatConfig(esxVI_Context *ctx, virDomainDefPtr def,
 
           default:
             ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "Unsupported graphics type '%s'",
+                      _("Unsupported graphics type '%s'"),
                       virDomainGraphicsTypeToString(def->graphics[i]->type));
             goto failure;
         }
@@ -2381,7 +2378,7 @@ esxVMX_FormatConfig(esxVI_Context *ctx, virDomainDefPtr def,
 
           default:
             ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "Unsupported disk device type '%s'",
+                      _("Unsupported disk device type '%s'"),
                       virDomainDiskDeviceTypeToString(def->disks[i]->device));
             goto failure;
         }
@@ -2440,7 +2437,7 @@ int
 esxVMX_FormatVNC(virDomainGraphicsDefPtr def, virBufferPtr buffer)
 {
     if (def->type != VIR_DOMAIN_GRAPHICS_TYPE_VNC) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -2490,7 +2487,7 @@ esxVMX_FormatHardDisk(esxVI_Context *ctx, virDomainDiskDefPtr def,
     char *fileName = NULL;
 
     if (def->device != VIR_DOMAIN_DISK_DEVICE_DISK) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -2514,14 +2511,14 @@ esxVMX_FormatHardDisk(esxVI_Context *ctx, virDomainDiskDefPtr def,
         }
     } else {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Unsupported bus type '%s' for harddisk",
+                  _("Unsupported bus type '%s' for harddisk"),
                   virDomainDiskBusTypeToString(def->bus));
         return -1;
     }
 
     if (def->type != VIR_DOMAIN_DISK_TYPE_FILE) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "%s harddisk '%s' has unsupported type '%s', expecting '%s'",
+                  _("%s harddisk '%s' has unsupported type '%s', expecting '%s'"),
                   busName, def->dst, virDomainDiskTypeToString(def->type),
                   virDomainDiskTypeToString(VIR_DOMAIN_DISK_TYPE_FILE));
         return -1;
@@ -2535,8 +2532,8 @@ esxVMX_FormatHardDisk(esxVI_Context *ctx, virDomainDiskDefPtr def,
     if (def->src != NULL) {
         if (! virFileHasSuffix(def->src, ".vmdk")) {
             ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "Image file for %s harddisk '%s' has unsupported suffix, "
-                      "expecting '.vmdk'", busName, def->dst);
+                      _("Image file for %s harddisk '%s' has unsupported suffix, "
+                        "expecting '.vmdk'"), busName, def->dst);
             return -1;
         }
 
@@ -2558,7 +2555,7 @@ esxVMX_FormatHardDisk(esxVI_Context *ctx, virDomainDiskDefPtr def,
                               entryPrefix, controller, id);
         } else if (def->cachemode != VIR_DOMAIN_DISK_CACHE_DEFAULT) {
             ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "%s harddisk '%s' has unsupported cache mode '%s'",
+                      _("%s harddisk '%s' has unsupported cache mode '%s'"),
                       busName, def->dst,
                       virDomainDiskCacheTypeToString(def->cachemode));
             return -1;
@@ -2580,7 +2577,7 @@ esxVMX_FormatCDROM(esxVI_Context *ctx, virDomainDiskDefPtr def,
     char *fileName = NULL;
 
     if (def->device != VIR_DOMAIN_DISK_DEVICE_CDROM) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -2601,7 +2598,8 @@ esxVMX_FormatCDROM(esxVI_Context *ctx, virDomainDiskDefPtr def,
             return -1;
         }
     } else {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "Unsupported bus type '%s' for cdrom",
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
+                  _("Unsupported bus type '%s' for cdrom"),
                   virDomainDiskBusTypeToString(def->bus));
         return -1;
     }
@@ -2616,8 +2614,8 @@ esxVMX_FormatCDROM(esxVI_Context *ctx, virDomainDiskDefPtr def,
         if (def->src != NULL) {
             if (! virFileHasSuffix(def->src, ".iso")) {
                 ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                          "Image file for %s cdrom '%s' has unsupported "
-                          "suffix, expecting '.iso'", busName, def->dst);
+                          _("Image file for %s cdrom '%s' has unsupported "
+                            "suffix, expecting '.iso'"), busName, def->dst);
                 return -1;
             }
 
@@ -2642,8 +2640,8 @@ esxVMX_FormatCDROM(esxVI_Context *ctx, virDomainDiskDefPtr def,
         }
     } else {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "%s cdrom '%s' has unsupported type '%s', expecting '%s' "
-                  "or '%s'", busName, def->dst,
+                  _("%s cdrom '%s' has unsupported type '%s', expecting '%s' "
+                    "or '%s'"), busName, def->dst,
                   virDomainDiskTypeToString(def->type),
                   virDomainDiskTypeToString(VIR_DOMAIN_DISK_TYPE_FILE),
                   virDomainDiskTypeToString(VIR_DOMAIN_DISK_TYPE_BLOCK));
@@ -2663,7 +2661,7 @@ esxVMX_FormatFloppy(esxVI_Context *ctx, virDomainDiskDefPtr def,
     char *fileName = NULL;
 
     if (def->device != VIR_DOMAIN_DISK_DEVICE_FLOPPY) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "Invalid argument");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
         return -1;
     }
 
@@ -2680,8 +2678,8 @@ esxVMX_FormatFloppy(esxVI_Context *ctx, virDomainDiskDefPtr def,
         if (def->src != NULL) {
             if (! virFileHasSuffix(def->src, ".flp")) {
                 ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                          "Image file for floppy '%s' has unsupported suffix, "
-                          "expecting '.flp'", def->dst);
+                          _("Image file for floppy '%s' has unsupported "
+                            "suffix, expecting '.flp'"), def->dst);
                 return -1;
             }
 
@@ -2706,8 +2704,8 @@ esxVMX_FormatFloppy(esxVI_Context *ctx, virDomainDiskDefPtr def,
         }
     } else {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Floppy '%s' has unsupported type '%s', expecting '%s' "
-                  "or '%s'", def->dst,
+                  _("Floppy '%s' has unsupported type '%s', expecting '%s' "
+                    "or '%s'"), def->dst,
                   virDomainDiskTypeToString(def->type),
                   virDomainDiskTypeToString(VIR_DOMAIN_DISK_TYPE_FILE),
                   virDomainDiskTypeToString(VIR_DOMAIN_DISK_TYPE_BLOCK));
@@ -2728,7 +2726,7 @@ esxVMX_FormatEthernet(virDomainNetDefPtr def, int controller,
 
     if (controller < 0 || controller > 3) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Ethernet controller index %d out of [0..3] range",
+                  _("Ethernet controller index %d out of [0..3] range"),
                   controller);
         return -1;
     }
@@ -2742,9 +2740,9 @@ esxVMX_FormatEthernet(virDomainNetDefPtr def, int controller,
             STRCASENEQ(def->model, "vmxnet3") &&
             STRCASENEQ(def->model, "e1000")) {
             ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                      "Expecting domain XML entry 'devices/interfase/model' "
-                      "to be 'vlance' or 'vmxnet' or 'vmxnet3' or 'e1000' but "
-                      "found '%s'", def->model);
+                      _("Expecting domain XML entry 'devices/interfase/model' "
+                        "to be 'vlance' or 'vmxnet' or 'vmxnet3' or 'e1000' "
+                        "but found '%s'"), def->model);
             return -1;
         }
 
@@ -2771,7 +2769,7 @@ esxVMX_FormatEthernet(virDomainNetDefPtr def, int controller,
         break;
 
       default:
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "Unsupported net type '%s'",
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, _("Unsupported net type '%s'"),
                   virDomainNetTypeToString(def->type));
         return -1;
     }
@@ -2821,14 +2819,15 @@ esxVMX_FormatSerial(esxVI_Context *ctx, virDomainChrDefPtr def,
 
     if (def->target.port < 0 || def->target.port > 3) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Serial port index %d out of [0..3] range", def->target.port);
+                  _("Serial port index %d out of [0..3] range"),
+                  def->target.port);
         return -1;
     }
 
     if (def->data.file.path == NULL) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Expecting domain XML attribute 'path' of entry "
-                  "'devices/serial/source' to be present");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                  _("Expecting domain XML attribute 'path' of entry "
+                    "'devices/serial/source' to be present"));
         return -1;
     }
 
@@ -2874,7 +2873,7 @@ esxVMX_FormatSerial(esxVI_Context *ctx, virDomainChrDefPtr def,
 
       default:
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Unsupported character device type '%s'",
+                  _("Unsupported character device type '%s'"),
                   virDomainChrTypeToString(def->type));
         return -1;
     }
@@ -2897,15 +2896,15 @@ esxVMX_FormatParallel(esxVI_Context *ctx, virDomainChrDefPtr def,
 
     if (def->target.port < 0 || def->target.port > 2) {
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Parallel port index %d out of [0..2] range",
+                  _("Parallel port index %d out of [0..2] range"),
                   def->target.port);
         return -1;
     }
 
     if (def->data.file.path == NULL) {
-        ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Expecting domain XML attribute 'path' of entry "
-                  "'devices/parallel/source' to be present");
+        ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+                  _("Expecting domain XML attribute 'path' of entry "
+                    "'devices/parallel/source' to be present"));
         return -1;
     }
 
@@ -2939,7 +2938,7 @@ esxVMX_FormatParallel(esxVI_Context *ctx, virDomainChrDefPtr def,
 
       default:
         ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
-                  "Unsupported character device type '%s'",
+                  _("Unsupported character device type '%s'"),
                   virDomainChrTypeToString(def->type));
         return -1;
     }