---
cfg.mk | 2 +
po/POTFILES.in | 6 +
src/esx/esx_driver.c | 211 +++++++++++++++++----------------
src/esx/esx_util.c | 58 +++++-----
src/esx/esx_vi.c | 274 +++++++++++++++++++++---------------------
src/esx/esx_vi_methods.c | 8 +-
src/esx/esx_vi_types.c | 70 ++++++-----
src/esx/esx_vmx.c | 300 +++++++++++++++++++++++-----------------------
8 files changed, 481 insertions(+), 448 deletions(-)
diff --git a/cfg.mk b/cfg.mk
index 619a8e2..8073f34 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -169,6 +169,8 @@ sc_prohibit_gethostby:
msg_gen_function =
msg_gen_function += ReportError
+msg_gen_function += ESX_ERROR
+msg_gen_function += ESX_VI_ERROR
msg_gen_function += errorf
msg_gen_function += lxcError
msg_gen_function += networkReportError
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 6c93e2a..a952910 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -17,6 +17,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
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
index e55c948..a5b87df 100644
--- a/src/esx/esx_driver.c
+++ b/src/esx/esx_driver.c
@@ -84,8 +84,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 +108,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 +124,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 +358,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 +370,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 +383,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 +457,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 +478,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 +496,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 +515,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 +614,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 +689,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 +726,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 +755,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 +825,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 +907,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 +1004,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 +1111,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 +1209,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 +1275,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 +1287,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 +1331,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 +1342,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 +1384,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 +1430,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 +1485,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 +1497,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 +1561,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 +1622,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 +1676,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 +1968,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 +1985,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 +2010,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 +2054,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 +2199,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 +2228,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 +2379,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 +2391,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 +2453,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 +2474,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 +2489,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 +2509,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 +2579,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 +2648,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 +2732,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 +2817,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 +2881,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 +2895,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 +2935,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 +2956,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 +3035,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 +3093,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 +3116,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 +3208,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;
}
diff --git a/src/esx/esx_util.c b/src/esx/esx_util.c
index 801b4b0..e8fd261 100644
--- a/src/esx/esx_util.c
+++ b/src/esx/esx_util.c
@@ -101,8 +101,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 +124,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 +136,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 +213,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 +234,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 +250,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 +302,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 +319,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 +347,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 +363,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 +392,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 +408,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 +438,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 +449,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 +458,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 +487,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 +498,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 +509,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;
}
diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c
index c1fd4b4..5ed1391 100644
--- a/src/esx/esx_vi.c
+++ b/src/esx/esx_vi.c
@@ -252,7 +252,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 +262,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 +282,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 +315,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 +327,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 +347,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 +372,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 +397,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 +407,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 +419,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 +431,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 +470,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 +498,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 +523,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 +542,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 +569,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 +588,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 +609,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 +646,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 +661,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 +677,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 +714,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 +726,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 +741,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 +752,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 +766,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 +834,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 +842,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 +856,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 +870,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 +886,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 +909,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 +926,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 +952,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 +981,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 +1015,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 +1025,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 +1034,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 +1071,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 +1097,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 +1108,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 +1143,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 +1167,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 +1218,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 +1336,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 +1387,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 +1423,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 +1499,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 +1521,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 +1537,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 +1622,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 +1631,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 +1639,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 +1664,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 +1692,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 +1735,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 +1754,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 +1768,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 +1788,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 +1817,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 +1856,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 +1872,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 +1911,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 +1950,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 +2003,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 +2039,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 +2064,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 +2089,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 +2135,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 +2159,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 +2193,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 +2245,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 +2383,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 +2408,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);
}
diff --git a/src/esx/esx_vi_methods.c b/src/esx/esx_vi_methods.c
index f1234ae..87b7910 100644
--- a/src/esx/esx_vi_methods.c
+++ b/src/esx/esx_vi_methods.c
@@ -109,7 +109,7 @@
#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; \
}
@@ -117,7 +117,7 @@
#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 +198,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 +276,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;
}
},
diff --git a/src/esx/esx_vi_types.c b/src/esx/esx_vi_types.c
index 3a30712..500f8f1 100644
--- a/src/esx/esx_vi_types.c
+++ b/src/esx/esx_vi_types.c
@@ -123,7 +123,8 @@
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; \
} \
\
@@ -213,7 +214,8 @@
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; \
} \
\
@@ -236,7 +238,8 @@
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; \
} \
\
@@ -274,7 +277,8 @@
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; \
} \
\
@@ -318,7 +322,8 @@
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; \
} \
\
@@ -565,7 +570,8 @@
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 +715,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 +730,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 +746,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 +797,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 +808,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 +819,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 +828,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 +845,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 +872,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 +1003,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 +1037,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 +1067,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 +1192,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 +1204,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 +1289,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 +1319,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 +1331,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;
}
diff --git a/src/esx/esx_vmx.c b/src/esx/esx_vmx.c
index c6a92bf..e4512b3 100644
--- a/src/esx/esx_vmx.c
+++ b/src/esx/esx_vmx.c
@@ -438,9 +438,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 +448,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 +478,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 +488,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 +513,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 +523,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 +559,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 +576,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 +602,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 +697,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 +758,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 +773,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 +784,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 +795,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 +826,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 +855,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 +887,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 +915,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 +926,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 +1177,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 +1242,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 +1273,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 +1354,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 +1372,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 +1407,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 +1430,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 +1439,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 +1456,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 +1534,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 +1576,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 +1585,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 +1613,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 +1622,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 +1642,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 +1706,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 +1769,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 +1779,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 +1802,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 +1833,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 +1853,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 +1901,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 +1980,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 +2024,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 +2093,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 +2159,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 +2194,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 +2214,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 +2226,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 +2250,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 +2264,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 +2278,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 +2300,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 +2333,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 +2383,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 +2442,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 +2492,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 +2516,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 +2537,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 +2560,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 +2582,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 +2603,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 +2619,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 +2645,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 +2666,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 +2683,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 +2709,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 +2731,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 +2745,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 +2774,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 +2824,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 +2878,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 +2901,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 +2943,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;
}
--
1.6.3.3