Replace use of ESX_ERROR & ESX_VI_ERROR with virReportError

Update the ESX driver to use virReportError instead of
the ESX_ERROR & ESX_VI_ERROR custom macros

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrange 2012-07-18 15:25:50 +01:00
parent 7f4ed3ec99
commit cf8cff035c
9 changed files with 728 additions and 741 deletions

2
cfg.mk
View File

@ -506,8 +506,6 @@ sc_avoid_attribute_unused_in_header:
# |grep -vE '^(qsort|if|close|assert|fputc|free|N_|vir.*GetName|.*Unlock|virNodeListDevices|virHashRemoveEntry|freeaddrinfo|.*[fF]ree|xdrmem_create|xmlXPathFreeObject|virUUIDFormat|openvzSetProgramSentinal|polkit_action_unref)$'
msg_gen_function =
msg_gen_function += ESX_ERROR
msg_gen_function += ESX_VI_ERROR
msg_gen_function += HYPERV_ERROR
msg_gen_function += PHYP_ERROR
msg_gen_function += VIR_ERROR

View File

@ -213,7 +213,7 @@ esxParseVMXFileName(const char *fileName, void *opaque)
if ((tmp = STRSKIP(copyOfFileName, "/vmfs/volumes/")) == NULL ||
(datastoreName = strtok_r(tmp, "/", &saveptr)) == NULL ||
(directoryAndFileName = strtok_r(NULL, "", &saveptr)) == NULL) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("File name '%s' doesn't have expected format "
"'/vmfs/volumes/<datastore>/<path>'"), fileName);
goto cleanup;
@ -228,7 +228,7 @@ esxParseVMXFileName(const char *fileName, void *opaque)
}
if (datastoreList == NULL) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("File name '%s' refers to non-existing datastore '%s'"),
fileName, datastoreName);
goto cleanup;
@ -250,7 +250,7 @@ esxParseVMXFileName(const char *fileName, void *opaque)
}
if (result == NULL) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not handle file name '%s'"), fileName);
goto cleanup;
}
@ -352,7 +352,7 @@ esxFormatVMXFileName(const char *fileName, void *opaque)
goto cleanup;
}
} else {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not handle file name '%s'"), fileName);
goto cleanup;
}
@ -407,7 +407,7 @@ esxAutodetectSCSIControllerModel(virDomainDiskDefPtr def, int *model,
vmDiskFileInfo = esxVI_VmDiskFileInfo_DynamicCast(fileInfo);
if (vmDiskFileInfo == NULL || vmDiskFileInfo->controllerType == NULL) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not lookup controller model for '%s'"), def->src);
goto cleanup;
}
@ -425,7 +425,7 @@ esxAutodetectSCSIControllerModel(virDomainDiskDefPtr def, int *model,
"ParaVirtualSCSIController")) {
*model = VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VMPVSCSI;
} else {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Found unexpected controller model '%s' for disk '%s'"),
vmDiskFileInfo->controllerType, def->src);
goto cleanup;
@ -468,7 +468,7 @@ esxSupportsLongMode(esxPrivate *priv)
}
if (hostSystem == NULL) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Could not retrieve the HostSystem object"));
goto cleanup;
}
@ -496,7 +496,7 @@ esxSupportsLongMode(esxPrivate *priv)
} else if (edxLongModeBit == '0') {
priv->supportsLongMode = esxVI_Boolean_False;
} else {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Bit 29 (Long Mode) of HostSystem property "
"'hardware.cpuFeature[].edx' with value '%s' "
"has unexpected value '%c', expecting '0' "
@ -548,7 +548,7 @@ esxLookupHostSystemBiosUuid(esxPrivate *priv, unsigned char *uuid)
}
if (hostSystem == NULL) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Could not retrieve the HostSystem object"));
goto cleanup;
}
@ -686,7 +686,7 @@ esxConnectToHost(virConnectPtr conn,
: esxVI_ProductVersion_GSX;
if (vCenterIpAddress == NULL || *vCenterIpAddress != NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
@ -705,7 +705,7 @@ esxConnectToHost(virConnectPtr conn,
username = virAuthGetUsername(conn, auth, "esx", "root", conn->uri->server);
if (username == NULL) {
ESX_ERROR(VIR_ERR_AUTH_FAILED, "%s", _("Username request failed"));
virReportError(VIR_ERR_AUTH_FAILED, "%s", _("Username request failed"));
goto cleanup;
}
}
@ -713,7 +713,7 @@ esxConnectToHost(virConnectPtr conn,
unescapedPassword = virAuthGetPassword(conn, auth, "esx", username, conn->uri->server);
if (unescapedPassword == NULL) {
ESX_ERROR(VIR_ERR_AUTH_FAILED, "%s", _("Password request failed"));
virReportError(VIR_ERR_AUTH_FAILED, "%s", _("Password request failed"));
goto cleanup;
}
@ -743,14 +743,14 @@ esxConnectToHost(virConnectPtr conn,
priv->host->productVersion != esxVI_ProductVersion_ESX4x &&
priv->host->productVersion != esxVI_ProductVersion_ESX50 &&
priv->host->productVersion != esxVI_ProductVersion_ESX5x) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("%s is neither an ESX 3.5, 4.x nor 5.x host"),
conn->uri->server);
goto cleanup;
}
} else { /* GSX */
if (priv->host->productVersion != esxVI_ProductVersion_GSX20) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("%s isn't a GSX 2.0 host"), conn->uri->server);
goto cleanup;
}
@ -816,7 +816,7 @@ esxConnectToVCenter(virConnectPtr conn,
if (hostSystemIpAddress == NULL &&
(priv->parsedUri->path == NULL || STREQ(priv->parsedUri->path, "/"))) {
ESX_ERROR(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("Path has to specify the datacenter and compute resource"));
return -1;
}
@ -836,7 +836,7 @@ esxConnectToVCenter(virConnectPtr conn,
username = virAuthGetUsername(conn, auth, "esx", "administrator", hostname);
if (username == NULL) {
ESX_ERROR(VIR_ERR_AUTH_FAILED, "%s", _("Username request failed"));
virReportError(VIR_ERR_AUTH_FAILED, "%s", _("Username request failed"));
goto cleanup;
}
}
@ -844,7 +844,7 @@ esxConnectToVCenter(virConnectPtr conn,
unescapedPassword = virAuthGetPassword(conn, auth, "esx", username, hostname);
if (unescapedPassword == NULL) {
ESX_ERROR(VIR_ERR_AUTH_FAILED, "%s", _("Password request failed"));
virReportError(VIR_ERR_AUTH_FAILED, "%s", _("Password request failed"));
goto cleanup;
}
@ -872,7 +872,7 @@ esxConnectToVCenter(virConnectPtr conn,
priv->vCenter->productVersion != esxVI_ProductVersion_VPX4x &&
priv->vCenter->productVersion != esxVI_ProductVersion_VPX50 &&
priv->vCenter->productVersion != esxVI_ProductVersion_VPX5x) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("%s is neither a vCenter 2.5, 4.x nor 5.x server"),
hostname);
goto cleanup;
@ -982,7 +982,7 @@ esxOpen(virConnectPtr conn, virConnectAuthPtr auth,
return VIR_DRV_OPEN_DECLINED;
}
ESX_ERROR(VIR_ERR_INVALID_ARG,
virReportError(VIR_ERR_INVALID_ARG,
_("Transport '%s' in URI scheme is not supported, try again "
"without the transport part"), plus + 1);
return VIR_DRV_OPEN_ERROR;
@ -996,14 +996,14 @@ esxOpen(virConnectPtr conn, virConnectAuthPtr auth,
/* Require server part */
if (conn->uri->server == NULL) {
ESX_ERROR(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("URI is missing the server part"));
return VIR_DRV_OPEN_ERROR;
}
/* Require auth */
if (auth == NULL || auth->cb == NULL) {
ESX_ERROR(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("Missing or invalid auth pointer"));
return VIR_DRV_OPEN_ERROR;
}
@ -1060,14 +1060,14 @@ esxOpen(virConnectPtr conn, virConnectAuthPtr auth,
if (priv->parsedUri->vCenter != NULL) {
if (STREQ(priv->parsedUri->vCenter, "*")) {
if (potentialVCenterIpAddress == NULL) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("This host is not managed by a vCenter"));
goto cleanup;
}
if (virStrcpyStatic(vCenterIpAddress,
potentialVCenterIpAddress) == NULL) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("vCenter IP address %s too big for destination"),
potentialVCenterIpAddress);
goto cleanup;
@ -1080,7 +1080,7 @@ esxOpen(virConnectPtr conn, virConnectAuthPtr auth,
if (potentialVCenterIpAddress != NULL &&
STRNEQ(vCenterIpAddress, potentialVCenterIpAddress)) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("This host is managed by a vCenter with IP "
"address %s, but a mismachting vCenter '%s' "
"(%s) has been specified"),
@ -1181,7 +1181,7 @@ esxSupportsVMotion(esxPrivate *priv)
}
if (hostSystem == NULL) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Could not retrieve the HostSystem object"));
goto cleanup;
}
@ -1245,7 +1245,7 @@ esxGetVersion(virConnectPtr conn, unsigned long *version)
if (virParseVersionString(priv->primary->service->about->version,
version, false) < 0) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not parse version number from '%s'"),
priv->primary->service->about->version);
@ -1282,7 +1282,7 @@ esxGetHostname(virConnectPtr conn)
}
if (hostSystem == NULL) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Could not retrieve the HostSystem object"));
goto cleanup;
}
@ -1311,7 +1311,7 @@ esxGetHostname(virConnectPtr conn)
}
if (hostName == NULL || strlen(hostName) < 1) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Missing or empty 'hostName' property"));
goto cleanup;
}
@ -1380,7 +1380,7 @@ esxNodeGetInfo(virConnectPtr conn, virNodeInfoPtr nodeinfo)
}
if (hostSystem == NULL) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Could not retrieve the HostSystem object"));
goto cleanup;
}
@ -1461,7 +1461,7 @@ esxNodeGetInfo(virConnectPtr conn, virNodeInfoPtr nodeinfo)
if (virStrncpy(nodeinfo->model, dynamicProperty->val->string,
sizeof(nodeinfo->model) - 1,
sizeof(nodeinfo->model)) == NULL) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("CPU Model %s too long for destination"),
dynamicProperty->val->string);
goto cleanup;
@ -1550,7 +1550,7 @@ esxListDomains(virConnectPtr conn, int *ids, int maxids)
if (esxUtil_ParseVirtualMachineIDString(virtualMachine->obj->value,
&ids[count]) < 0 ||
ids[count] <= 0) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to parse positive integer from '%s'"),
virtualMachine->obj->value);
goto cleanup;
@ -1652,7 +1652,7 @@ esxDomainLookupByID(virConnectPtr conn, int id)
}
if (domain == NULL) {
ESX_ERROR(VIR_ERR_NO_DOMAIN, _("No domain with ID %d"), id);
virReportError(VIR_ERR_NO_DOMAIN, _("No domain with ID %d"), id);
}
cleanup:
@ -1740,7 +1740,7 @@ esxDomainLookupByName(virConnectPtr conn, const char *name)
}
if (virtualMachine == NULL) {
ESX_ERROR(VIR_ERR_NO_DOMAIN, _("No domain with name '%s'"), name);
virReportError(VIR_ERR_NO_DOMAIN, _("No domain with name '%s'"), name);
goto cleanup;
}
@ -1797,7 +1797,7 @@ esxDomainSuspend(virDomainPtr domain)
}
if (powerState != esxVI_VirtualMachinePowerState_PoweredOn) {
ESX_ERROR(VIR_ERR_OPERATION_INVALID, "%s",
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("Domain is not powered on"));
goto cleanup;
}
@ -1811,7 +1811,7 @@ esxDomainSuspend(virDomainPtr domain)
}
if (taskInfoState != esxVI_TaskInfoState_Success) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, _("Could not suspend domain: %s"),
virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not suspend domain: %s"),
taskInfoErrorMessage);
goto cleanup;
}
@ -1855,7 +1855,7 @@ esxDomainResume(virDomainPtr domain)
}
if (powerState != esxVI_VirtualMachinePowerState_Suspended) {
ESX_ERROR(VIR_ERR_OPERATION_INVALID, "%s", _("Domain is not suspended"));
virReportError(VIR_ERR_OPERATION_INVALID, "%s", _("Domain is not suspended"));
goto cleanup;
}
@ -1869,7 +1869,7 @@ esxDomainResume(virDomainPtr domain)
}
if (taskInfoState != esxVI_TaskInfoState_Success) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, _("Could not resume domain: %s"),
virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not resume domain: %s"),
taskInfoErrorMessage);
goto cleanup;
}
@ -1912,7 +1912,7 @@ esxDomainShutdownFlags(virDomainPtr domain, unsigned int flags)
}
if (powerState != esxVI_VirtualMachinePowerState_PoweredOn) {
ESX_ERROR(VIR_ERR_OPERATION_INVALID, "%s",
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("Domain is not powered on"));
goto cleanup;
}
@ -1963,7 +1963,7 @@ esxDomainReboot(virDomainPtr domain, unsigned int flags)
}
if (powerState != esxVI_VirtualMachinePowerState_PoweredOn) {
ESX_ERROR(VIR_ERR_OPERATION_INVALID, "%s",
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("Domain is not powered on"));
goto cleanup;
}
@ -2019,7 +2019,7 @@ esxDomainDestroyFlags(virDomainPtr domain,
}
if (powerState != esxVI_VirtualMachinePowerState_PoweredOn) {
ESX_ERROR(VIR_ERR_OPERATION_INVALID, "%s",
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("Domain is not powered on"));
goto cleanup;
}
@ -2033,7 +2033,7 @@ esxDomainDestroyFlags(virDomainPtr domain,
}
if (taskInfoState != esxVI_TaskInfoState_Success) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, _("Could not destroy domain: %s"),
virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not destroy domain: %s"),
taskInfoErrorMessage);
goto cleanup;
}
@ -2103,7 +2103,7 @@ esxDomainGetMaxMemory(virDomainPtr domain)
}
if (dynamicProperty->val->int32 < 0) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Got invalid memory size %d"),
dynamicProperty->val->int32);
} else {
@ -2152,7 +2152,7 @@ esxDomainSetMaxMemory(virDomainPtr domain, unsigned long memory)
}
if (powerState != esxVI_VirtualMachinePowerState_PoweredOff) {
ESX_ERROR(VIR_ERR_OPERATION_INVALID, "%s",
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("Domain is not powered off"));
goto cleanup;
}
@ -2176,7 +2176,7 @@ esxDomainSetMaxMemory(virDomainPtr domain, unsigned long memory)
}
if (taskInfoState != esxVI_TaskInfoState_Success) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not set max-memory to %lu kilobytes: %s"), memory,
taskInfoErrorMessage);
goto cleanup;
@ -2233,7 +2233,7 @@ esxDomainSetMemory(virDomainPtr domain, unsigned long memory)
}
if (taskInfoState != esxVI_TaskInfoState_Success) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not set memory to %lu kilobytes: %s"), memory,
taskInfoErrorMessage);
goto cleanup;
@ -2469,7 +2469,7 @@ esxDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info)
esxVI_PerfEntityMetric_DynamicCast(perfEntityMetricBase);
if (perfEntityMetric == NULL) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("QueryPerf returned object with unexpected type '%s'"),
esxVI_Type_ToString(perfEntityMetricBase->_type));
goto cleanup;
@ -2479,7 +2479,7 @@ esxDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info)
esxVI_PerfMetricIntSeries_DynamicCast(perfEntityMetric->value);
if (perfMetricIntSeries == NULL) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("QueryPerf returned object with unexpected type '%s'"),
esxVI_Type_ToString(perfEntityMetric->value->_type));
goto cleanup;
@ -2597,12 +2597,12 @@ esxDomainSetVcpusFlags(virDomainPtr domain, unsigned int nvcpus,
char *taskInfoErrorMessage = NULL;
if (flags != VIR_DOMAIN_AFFECT_LIVE) {
ESX_ERROR(VIR_ERR_INVALID_ARG, _("unsupported flags: (0x%x)"), flags);
virReportError(VIR_ERR_INVALID_ARG, _("unsupported flags: (0x%x)"), flags);
return -1;
}
if (nvcpus < 1) {
ESX_ERROR(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("Requested number of virtual CPUs must at least be 1"));
return -1;
}
@ -2618,7 +2618,7 @@ esxDomainSetVcpusFlags(virDomainPtr domain, unsigned int nvcpus,
}
if (nvcpus > maxVcpus) {
ESX_ERROR(VIR_ERR_INVALID_ARG,
virReportError(VIR_ERR_INVALID_ARG,
_("Requested number of virtual CPUs is greater than max "
"allowable number of virtual CPUs for the domain: %d > %d"),
nvcpus, maxVcpus);
@ -2645,7 +2645,7 @@ esxDomainSetVcpusFlags(virDomainPtr domain, unsigned int nvcpus,
}
if (taskInfoState != esxVI_TaskInfoState_Success) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not set number of virtual CPUs to %d: %s"), nvcpus,
taskInfoErrorMessage);
goto cleanup;
@ -2681,7 +2681,7 @@ esxDomainGetVcpusFlags(virDomainPtr domain, unsigned int flags)
esxVI_DynamicProperty *dynamicProperty = NULL;
if (flags != (VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_VCPU_MAXIMUM)) {
ESX_ERROR(VIR_ERR_INVALID_ARG, _("unsupported flags: (0x%x)"), flags);
virReportError(VIR_ERR_INVALID_ARG, _("unsupported flags: (0x%x)"), flags);
return -1;
}
@ -2703,7 +2703,7 @@ esxDomainGetVcpusFlags(virDomainPtr domain, unsigned int flags)
}
if (hostSystem == NULL) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Could not retrieve the HostSystem object"));
goto cleanup;
}
@ -2873,7 +2873,7 @@ esxDomainXMLFromNative(virConnectPtr conn, const char *nativeFormat,
memset(&data, 0, sizeof(data));
if (STRNEQ(nativeFormat, "vmware-vmx")) {
ESX_ERROR(VIR_ERR_INVALID_ARG,
virReportError(VIR_ERR_INVALID_ARG,
_("Unsupported config format '%s'"), nativeFormat);
return NULL;
}
@ -2916,7 +2916,7 @@ esxDomainXMLToNative(virConnectPtr conn, const char *nativeFormat,
memset(&data, 0, sizeof(data));
if (STRNEQ(nativeFormat, "vmware-vmx")) {
ESX_ERROR(VIR_ERR_INVALID_ARG,
virReportError(VIR_ERR_INVALID_ARG,
_("Unsupported config format '%s'"), nativeFormat);
return NULL;
}
@ -3069,7 +3069,7 @@ esxDomainCreateWithFlags(virDomainPtr domain, unsigned int flags)
}
if (powerState != esxVI_VirtualMachinePowerState_PoweredOff) {
ESX_ERROR(VIR_ERR_OPERATION_INVALID, "%s",
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("Domain is not powered off"));
goto cleanup;
}
@ -3084,7 +3084,7 @@ esxDomainCreateWithFlags(virDomainPtr domain, unsigned int flags)
}
if (taskInfoState != esxVI_TaskInfoState_Success) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, _("Could not start domain: %s"),
virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not start domain: %s"),
taskInfoErrorMessage);
goto cleanup;
}
@ -3167,7 +3167,7 @@ esxDomainDefineXML(virConnectPtr conn, const char *xml)
if (virtualMachine != NULL) {
/* FIXME */
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Domain already exists, editing existing domains is not "
"supported yet"));
goto cleanup;
@ -3203,7 +3203,7 @@ esxDomainDefineXML(virConnectPtr conn, const char *xml)
* datastore isn't perfect but should work in the majority of cases.
*/
if (def->ndisks < 1) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Domain XML doesn't contain any disks, cannot deduce "
"datastore and path for VMX file"));
goto cleanup;
@ -3218,14 +3218,14 @@ esxDomainDefineXML(virConnectPtr conn, const char *xml)
}
if (disk == NULL) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Domain XML doesn't contain any file-based harddisks, "
"cannot deduce datastore and path for VMX file"));
goto cleanup;
}
if (disk->src == NULL) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("First file-based harddisk has no source, cannot deduce "
"datastore and path for VMX file"));
goto cleanup;
@ -3237,7 +3237,7 @@ esxDomainDefineXML(virConnectPtr conn, const char *xml)
}
if (! virFileHasSuffix(disk->src, ".vmdk")) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Expecting source '%s' of first file-based harddisk to "
"be a VMDK image"), disk->src);
goto cleanup;
@ -3308,7 +3308,7 @@ esxDomainDefineXML(virConnectPtr conn, const char *xml)
}
if (taskInfoState != esxVI_TaskInfoState_Success) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, _("Could not define domain: %s"),
virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not define domain: %s"),
taskInfoErrorMessage);
goto cleanup;
}
@ -3382,7 +3382,7 @@ esxDomainUndefineFlags(virDomainPtr domain,
if (powerState != esxVI_VirtualMachinePowerState_Suspended &&
powerState != esxVI_VirtualMachinePowerState_PoweredOff) {
ESX_ERROR(VIR_ERR_OPERATION_INVALID, "%s",
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("Domain is not suspended or powered off"));
goto cleanup;
}
@ -3528,7 +3528,7 @@ esxDomainSetAutostart(virDomainPtr domain, int autostart)
for (powerInfo = powerInfoList; powerInfo != NULL;
powerInfo = powerInfo->_next) {
if (STRNEQ(powerInfo->key->value, virtualMachine->obj->value)) {
ESX_ERROR(VIR_ERR_OPERATION_INVALID, "%s",
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("Cannot enable general autostart option "
"without affecting other domains"));
goto cleanup;
@ -3735,7 +3735,7 @@ esxDomainGetSchedulerParametersFlags(virDomainPtr domain,
break;
default:
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Shares level has unknown value %d"),
(int)sharesInfo->level);
goto cleanup;
@ -3813,7 +3813,7 @@ esxDomainSetSchedulerParametersFlags(virDomainPtr domain,
}
if (params[i].value.l < 0) {
ESX_ERROR(VIR_ERR_INVALID_ARG,
virReportError(VIR_ERR_INVALID_ARG,
_("Could not set reservation to %lld MHz, expecting "
"positive value"), params[i].value.l);
goto cleanup;
@ -3826,7 +3826,7 @@ esxDomainSetSchedulerParametersFlags(virDomainPtr domain,
}
if (params[i].value.l < -1) {
ESX_ERROR(VIR_ERR_INVALID_ARG,
virReportError(VIR_ERR_INVALID_ARG,
_("Could not set limit to %lld MHz, expecting "
"positive value or -1 (unlimited)"),
params[i].value.l);
@ -3865,7 +3865,7 @@ esxDomainSetSchedulerParametersFlags(virDomainPtr domain,
break;
default:
ESX_ERROR(VIR_ERR_INVALID_ARG,
virReportError(VIR_ERR_INVALID_ARG,
_("Could not set shares to %d, expecting positive "
"value or -1 (low), -2 (normal) or -3 (high)"),
params[i].value.i);
@ -3885,7 +3885,7 @@ esxDomainSetSchedulerParametersFlags(virDomainPtr domain,
}
if (taskInfoState != esxVI_TaskInfoState_Success) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not change scheduler parameters: %s"),
taskInfoErrorMessage);
goto cleanup;
@ -3971,13 +3971,13 @@ esxDomainMigratePerform(virDomainPtr domain,
virCheckFlags(ESX_MIGRATION_FLAGS, -1);
if (priv->vCenter == NULL) {
ESX_ERROR(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("Migration not possible without a vCenter"));
return -1;
}
if (dname != NULL) {
ESX_ERROR(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("Renaming domains on migration not supported"));
return -1;
}
@ -3991,13 +3991,13 @@ esxDomainMigratePerform(virDomainPtr domain,
return -1;
if (parsedUri->scheme == NULL || STRCASENEQ(parsedUri->scheme, "vpxmigr")) {
ESX_ERROR(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("Only vpxmigr:// migration URIs are supported"));
goto cleanup;
}
if (STRCASENEQ(priv->vCenter->ipAddress, parsedUri->server)) {
ESX_ERROR(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("Migration source and destination have to refer to "
"the same vCenter"));
goto cleanup;
@ -4007,7 +4007,7 @@ esxDomainMigratePerform(virDomainPtr domain,
path_hostSystem = strtok_r(NULL, "", &saveptr);
if (path_resourcePool == NULL || path_hostSystem == NULL) {
ESX_ERROR(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("Migration URI has to specify resource pool and host system"));
goto cleanup;
}
@ -4042,11 +4042,11 @@ esxDomainMigratePerform(virDomainPtr domain,
* to the first event for now.
*/
if (eventList->fullFormattedMessage != NULL) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not migrate domain, validation reported a "
"problem: %s"), eventList->fullFormattedMessage);
} else {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Could not migrate domain, validation reported a "
"problem"));
}
@ -4068,7 +4068,7 @@ esxDomainMigratePerform(virDomainPtr domain,
}
if (taskInfoState != esxVI_TaskInfoState_Success) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not migrate domain, migration task finished with "
"an error: %s"),
taskInfoErrorMessage);
@ -4143,7 +4143,7 @@ esxNodeGetFreeMemory(virConnectPtr conn)
}
if (resourcePoolResourceUsage == NULL) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Could not retrieve memory usage of resource pool"));
goto cleanup;
}
@ -4324,7 +4324,7 @@ esxDomainSnapshotCreateXML(virDomainPtr domain, const char *xmlDesc,
}
if (def->ndisks) {
ESX_ERROR(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("disk snapshots not supported yet"));
return NULL;
}
@ -4341,7 +4341,7 @@ esxDomainSnapshotCreateXML(virDomainPtr domain, const char *xmlDesc,
}
if (snapshotTree != NULL) {
ESX_ERROR(VIR_ERR_OPERATION_INVALID,
virReportError(VIR_ERR_OPERATION_INVALID,
_("Snapshot '%s' already exists"), def->name);
goto cleanup;
}
@ -4358,7 +4358,7 @@ esxDomainSnapshotCreateXML(virDomainPtr domain, const char *xmlDesc,
}
if (taskInfoState != esxVI_TaskInfoState_Success) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, _("Could not create snapshot: %s"),
virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not create snapshot: %s"),
taskInfoErrorMessage);
goto cleanup;
}
@ -4486,7 +4486,7 @@ esxDomainSnapshotListNames(virDomainPtr domain, char **names, int nameslen,
leaves = (flags & VIR_DOMAIN_SNAPSHOT_LIST_LEAVES) != 0;
if (names == NULL || nameslen < 0) {
ESX_ERROR(VIR_ERR_INVALID_ARG, "%s", _("Invalid argument"));
virReportError(VIR_ERR_INVALID_ARG, "%s", _("Invalid argument"));
return -1;
}
@ -4579,7 +4579,7 @@ esxDomainSnapshotListChildrenNames(virDomainSnapshotPtr snapshot,
leaves = (flags & VIR_DOMAIN_SNAPSHOT_LIST_LEAVES) != 0;
if (names == NULL || nameslen < 0) {
ESX_ERROR(VIR_ERR_INVALID_ARG, "%s", _("Invalid argument"));
virReportError(VIR_ERR_INVALID_ARG, "%s", _("Invalid argument"));
return -1;
}
@ -4701,7 +4701,7 @@ esxDomainSnapshotGetParent(virDomainSnapshotPtr snapshot, unsigned int flags)
}
if (!snapshotTreeParent) {
ESX_ERROR(VIR_ERR_NO_DOMAIN_SNAPSHOT,
virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT,
_("snapshot '%s' does not have a parent"),
snapshotTree->name);
goto cleanup;
@ -4849,7 +4849,7 @@ esxDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, unsigned int flags)
}
if (taskInfoState != esxVI_TaskInfoState_Success) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not revert to snapshot '%s': %s"), snapshot->name,
taskInfoErrorMessage);
goto cleanup;
@ -4915,7 +4915,7 @@ esxDomainSnapshotDelete(virDomainSnapshotPtr snapshot, unsigned int flags)
}
if (taskInfoState != esxVI_TaskInfoState_Success) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not delete snapshot '%s': %s"), snapshot->name,
taskInfoErrorMessage);
goto cleanup;
@ -4986,7 +4986,7 @@ esxDomainSetMemoryParameters(virDomainPtr domain, virTypedParameterPtr params,
}
if (taskInfoState != esxVI_TaskInfoState_Success) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not change memory parameters: %s"),
taskInfoErrorMessage);
goto cleanup;

View File

@ -28,10 +28,6 @@
# include "capabilities.h"
# include "esx_vi.h"
# define ESX_ERROR(code, ...) \
virReportErrorHelper(VIR_FROM_ESX, code, __FILE__, __FUNCTION__, \
__LINE__, __VA_ARGS__)
typedef struct _esxPrivate {
esxVI_Context *primary; /* points to host or vCenter */
esxVI_Context *host;

View File

@ -84,7 +84,7 @@ esxStoragePoolLookupType(esxVI_Context *ctx, const char *poolName,
} else if (esxVI_VmfsDatastoreInfo_DynamicCast(datastoreInfo) != NULL) {
*poolType = VIR_STORAGE_POOL_FS;
} else {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("DatastoreInfo has unexpected type"));
goto cleanup;
}
@ -336,7 +336,7 @@ esxStoragePoolLookupByUUID(virConnectPtr conn, const unsigned char *uuid)
if (datastore == NULL) {
virUUIDFormat(uuid, uuid_string);
ESX_VI_ERROR(VIR_ERR_NO_STORAGE_POOL,
virReportError(VIR_ERR_NO_STORAGE_POOL,
_("Could not find datastore with UUID '%s'"),
uuid_string);
@ -557,7 +557,7 @@ esxStoragePoolGetXMLDesc(virStoragePoolPtr pool, unsigned int flags)
} else if (STRCASEEQ(nasInfo->nas->type, "CIFS")) {
def.source.format = VIR_STORAGE_POOL_NETFS_CIFS;
} else {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Datastore has unexpected type '%s'"),
nasInfo->nas->type);
goto cleanup;
@ -569,7 +569,7 @@ esxStoragePoolGetXMLDesc(virStoragePoolPtr pool, unsigned int flags)
* VMFS based datastore in libvirt terms
*/
} else {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("DatastoreInfo has unexpected type"));
goto cleanup;
}
@ -607,7 +607,7 @@ esxStoragePoolSetAutostart(virStoragePoolPtr pool ATTRIBUTE_UNUSED,
autostart = (autostart != 0);
if (! autostart) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Cannot deactivate storage pool autostart"));
return -1;
}
@ -670,7 +670,7 @@ esxStoragePoolListStorageVolumes(virStoragePoolPtr pool, char **const names,
int i;
if (names == NULL || maxnames < 0) {
ESX_ERROR(VIR_ERR_INVALID_ARG, "%s", _("Invalid argument"));
virReportError(VIR_ERR_INVALID_ARG, "%s", _("Invalid argument"));
return -1;
}
@ -837,7 +837,7 @@ esxStorageVolumeLookupByKey(virConnectPtr conn, const char *key)
}
if (!priv->primary->hasQueryVirtualDiskUuid) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("QueryVirtualDiskUuid not available, cannot lookup storage "
"volume by UUID"));
return NULL;
@ -999,7 +999,7 @@ esxStorageVolumeCreateXML(virStoragePoolPtr pool, const char *xmldesc,
}
if (def->type != VIR_STORAGE_VOL_FILE) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Creating non-file volumes is not supported"));
goto cleanup;
}
@ -1008,14 +1008,14 @@ esxStorageVolumeCreateXML(virStoragePoolPtr pool, const char *xmldesc,
tmp = strrchr(def->name, '/');
if (tmp == NULL || *def->name == '/' || tmp[1] == '\0') {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Volume name '%s' doesn't have expected format "
"'<directory>/<file>'"), def->name);
goto cleanup;
}
if (! virFileHasSuffix(def->name, ".vmdk")) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Volume name '%s' has unsupported suffix, expecting '.vmdk'"),
def->name);
goto cleanup;
@ -1095,7 +1095,7 @@ esxStorageVolumeCreateXML(virStoragePoolPtr pool, const char *xmldesc,
*/
virtualDiskSpec->diskType = (char *)"thin";
} else {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Unsupported capacity-to-allocation relation"));
goto cleanup;
}
@ -1122,7 +1122,7 @@ esxStorageVolumeCreateXML(virStoragePoolPtr pool, const char *xmldesc,
}
if (taskInfoState != esxVI_TaskInfoState_Success) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, _("Could not create volume: %s"),
virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not create volume: %s"),
taskInfoErrorMessage);
goto cleanup;
}
@ -1149,7 +1149,7 @@ esxStorageVolumeCreateXML(virStoragePoolPtr pool, const char *xmldesc,
}
}
} else {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Creation of %s volumes is not supported"),
virStorageFileFormatTypeToString(def->target.format));
goto cleanup;
@ -1233,7 +1233,7 @@ esxStorageVolumeCreateXMLFrom(virStoragePoolPtr pool, const char *xmldesc,
}
if (def->type != VIR_STORAGE_VOL_FILE) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Creating non-file volumes is not supported"));
goto cleanup;
}
@ -1242,14 +1242,14 @@ esxStorageVolumeCreateXMLFrom(virStoragePoolPtr pool, const char *xmldesc,
tmp = strrchr(def->name, '/');
if (tmp == NULL || *def->name == '/' || tmp[1] == '\0') {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Volume name '%s' doesn't have expected format "
"'<directory>/<file>'"), def->name);
goto cleanup;
}
if (! virFileHasSuffix(def->name, ".vmdk")) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Volume name '%s' has unsupported suffix, expecting '.vmdk'"),
def->name);
goto cleanup;
@ -1324,7 +1324,7 @@ esxStorageVolumeCreateXMLFrom(virStoragePoolPtr pool, const char *xmldesc,
}
if (taskInfoState != esxVI_TaskInfoState_Success) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, _("Could not copy volume: %s"),
virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not copy volume: %s"),
taskInfoErrorMessage);
goto cleanup;
}
@ -1351,7 +1351,7 @@ esxStorageVolumeCreateXMLFrom(virStoragePoolPtr pool, const char *xmldesc,
}
}
} else {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Creation of %s volumes is not supported"),
virStorageFileFormatTypeToString(def->target.format));
goto cleanup;
@ -1412,7 +1412,7 @@ esxStorageVolumeDelete(virStorageVolPtr volume, unsigned int flags)
}
if (taskInfoState != esxVI_TaskInfoState_Success) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, _("Could not delete volume: %s"),
virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not delete volume: %s"),
taskInfoErrorMessage);
goto cleanup;
}
@ -1461,7 +1461,7 @@ esxStorageVolumeWipe(virStorageVolPtr volume, unsigned int flags)
}
if (taskInfoState != esxVI_TaskInfoState_Success) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, _("Could not wipe volume: %s"),
virReportError(VIR_ERR_INTERNAL_ERROR, _("Could not wipe volume: %s"),
taskInfoErrorMessage);
goto cleanup;
}
@ -1595,7 +1595,7 @@ esxStorageVolumeGetXMLDesc(virStorageVolPtr volume, unsigned int flags)
def.target.format = VIR_STORAGE_FILE_RAW;
} else {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("File '%s' has unknown type"), datastorePath);
goto cleanup;
}

View File

@ -50,7 +50,7 @@ esxUtil_ParseUri(esxUtil_ParsedUri **parsedUri, virURIPtr uri)
char *tmp;
if (parsedUri == NULL || *parsedUri != NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
@ -74,7 +74,7 @@ esxUtil_ParseUri(esxUtil_ParsedUri **parsedUri, virURIPtr uri)
if (STRNEQ((*parsedUri)->transport, "http") &&
STRNEQ((*parsedUri)->transport, "https")) {
ESX_ERROR(VIR_ERR_INVALID_ARG,
virReportError(VIR_ERR_INVALID_ARG,
_("Query parameter 'transport' has unexpected value "
"'%s' (should be http|https)"),
(*parsedUri)->transport);
@ -92,7 +92,7 @@ esxUtil_ParseUri(esxUtil_ParsedUri **parsedUri, virURIPtr uri)
} else if (STRCASEEQ(queryParam->name, "no_verify")) {
if (virStrToLong_i(queryParam->value, NULL, 10, &noVerify) < 0 ||
(noVerify != 0 && noVerify != 1)) {
ESX_ERROR(VIR_ERR_INVALID_ARG,
virReportError(VIR_ERR_INVALID_ARG,
_("Query parameter 'no_verify' has unexpected value "
"'%s' (should be 0 or 1)"), queryParam->value);
goto cleanup;
@ -102,7 +102,7 @@ esxUtil_ParseUri(esxUtil_ParsedUri **parsedUri, virURIPtr uri)
} else if (STRCASEEQ(queryParam->name, "auto_answer")) {
if (virStrToLong_i(queryParam->value, NULL, 10, &autoAnswer) < 0 ||
(autoAnswer != 0 && autoAnswer != 1)) {
ESX_ERROR(VIR_ERR_INVALID_ARG,
virReportError(VIR_ERR_INVALID_ARG,
_("Query parameter 'auto_answer' has unexpected "
"value '%s' (should be 0 or 1)"), queryParam->value);
goto cleanup;
@ -128,7 +128,7 @@ esxUtil_ParseUri(esxUtil_ParsedUri **parsedUri, virURIPtr uri)
} else if ((tmp = strstr(queryParam->value, "://")) != NULL) {
*tmp = '\0';
ESX_ERROR(VIR_ERR_INVALID_ARG,
virReportError(VIR_ERR_INVALID_ARG,
_("Query parameter 'proxy' contains unexpected "
"type '%s' (should be (http|socks(|4|4a|5))"),
queryParam->value);
@ -146,7 +146,7 @@ esxUtil_ParseUri(esxUtil_ParsedUri **parsedUri, virURIPtr uri)
if ((tmp = strchr((*parsedUri)->proxy_hostname, ':')) != NULL) {
if (tmp == (*parsedUri)->proxy_hostname) {
ESX_ERROR(VIR_ERR_INVALID_ARG, "%s",
virReportError(VIR_ERR_INVALID_ARG, "%s",
_("Query parameter 'proxy' doesn't contain a "
"hostname"));
goto cleanup;
@ -158,7 +158,7 @@ esxUtil_ParseUri(esxUtil_ParsedUri **parsedUri, virURIPtr uri)
&(*parsedUri)->proxy_port) < 0 ||
(*parsedUri)->proxy_port < 1 ||
(*parsedUri)->proxy_port > 65535) {
ESX_ERROR(VIR_ERR_INVALID_ARG,
virReportError(VIR_ERR_INVALID_ARG,
_("Query parameter 'proxy' has unexpected port"
"value '%s' (should be [1..65535])"), tmp);
goto cleanup;
@ -255,7 +255,7 @@ esxUtil_ParseDatastorePath(const char *datastorePath, char **datastoreName,
if ((datastoreName != NULL && *datastoreName != NULL) ||
(directoryName != NULL && *directoryName != NULL) ||
(directoryAndFileName != NULL && *directoryAndFileName != NULL)) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
@ -266,7 +266,7 @@ esxUtil_ParseDatastorePath(const char *datastorePath, char **datastoreName,
/* Expected format: '[<datastore>] <path>' where <path> is optional */
if ((tmp = STRSKIP(copyOfDatastorePath, "[")) == NULL || *tmp == ']' ||
(preliminaryDatastoreName = strtok_r(tmp, "]", &saveptr)) == NULL) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Datastore path '%s' doesn't have expected format "
"'[<datastore>] <path>'"), datastorePath);
goto cleanup;
@ -349,14 +349,14 @@ esxUtil_ResolveHostname(const char *hostname,
errcode = getaddrinfo(hostname, NULL, &hints, &result);
if (errcode != 0) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("IP address lookup for host '%s' failed: %s"), hostname,
gai_strerror(errcode));
return -1;
}
if (result == NULL) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("No IP address for host '%s' found: %s"), hostname,
gai_strerror(errcode));
return -1;
@ -366,7 +366,7 @@ esxUtil_ResolveHostname(const char *hostname,
ipAddress_length, NULL, 0, NI_NUMERICHOST);
if (errcode != 0) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Formatting IP address for host '%s' failed: %s"), hostname,
gai_strerror(errcode));
freeaddrinfo(result);
@ -386,7 +386,7 @@ esxUtil_ReformatUuid(const char *input, char *output)
unsigned char uuid[VIR_UUID_BUFLEN];
if (virUUIDParse(input, uuid) < 0) {
ESX_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Could not parse UUID from string '%s'"),
input);
return -1;

File diff suppressed because it is too large Load Diff

View File

@ -35,13 +35,6 @@
# include "esx_util.h"
# define ESX_VI_ERROR(code, ...) \
virReportErrorHelper(VIR_FROM_ESX, code, __FILE__, __FUNCTION__, \
__LINE__, __VA_ARGS__)
# define ESX_VI__SOAP__REQUEST_HEADER \
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" \
"<soapenv:Envelope\n" \

View File

@ -41,7 +41,7 @@
#define ESX_VI__METHOD__CHECK_OUTPUT__NotNone \
if (output == NULL || *output != 0) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument")); \
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument")); \
return -1; \
}
@ -162,7 +162,7 @@
esxVI_##_type *_this = NULL; \
\
if (ctx->service == NULL) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid call")); \
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid call")); \
return -1; \
} \
\
@ -183,7 +183,7 @@
*/
#define ESX_VI__METHOD__PARAMETER__REQUIRE(_name) \
if (_name == 0) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
virReportError(VIR_ERR_INTERNAL_ERROR, \
"Required parameter '%s' is missing for call to %s", \
#_name, methodName); \
return -1; \
@ -237,7 +237,7 @@ esxVI_RetrieveServiceContent(esxVI_Context *ctx,
esxVI_Response *response = NULL;
if (serviceContent == NULL || *serviceContent != NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}

View File

@ -81,7 +81,7 @@
\
if (item->_type <= esxVI_Type_Undefined || \
item->_type >= esxVI_Type_Other) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
virReportError(VIR_ERR_INTERNAL_ERROR, \
_("%s object has invalid dynamic type"), typeName);\
return -1; \
} \
@ -98,7 +98,7 @@
esxVI_##_type##_DeepCopy(esxVI_##_type **dest, esxVI_##_type *src) \
{ \
if (dest == NULL || *dest != NULL) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", \
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", \
_("Invalid argument")); \
return -1; \
} \
@ -192,7 +192,7 @@
_dest_type *item ATTRIBUTE_UNUSED; \
\
if (anyType == NULL || ptrptr == NULL || *ptrptr != NULL) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", \
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", \
_("Invalid argument")); \
return -1; \
} \
@ -211,7 +211,7 @@
ESX_VI__TEMPLATE__CAST_FROM_ANY_TYPE_EXTRA(_type, esxVI_##_type, \
{ \
if (anyType->type != esxVI_Type_##_type) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
virReportError(VIR_ERR_INTERNAL_ERROR, \
_("Call to %s for unexpected type '%s'"), \
__FUNCTION__, anyType->other); \
return -1; \
@ -224,7 +224,7 @@
ESX_VI__TEMPLATE__CAST_FROM_ANY_TYPE_EXTRA(_type, _value_type, \
{ \
if (anyType->type != esxVI_Type_##_type) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
virReportError(VIR_ERR_INTERNAL_ERROR, \
_("Call to %s for unexpected type '%s'"), \
__FUNCTION__, anyType->other); \
return -1; \
@ -239,7 +239,7 @@
const char *element, virBufferPtr output) \
{ \
if (element == NULL || output == NULL ) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", \
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", \
_("Invalid argument")); \
return -1; \
} \
@ -281,7 +281,7 @@
_extra1 \
\
if (ptrptr == NULL || *ptrptr != NULL) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", \
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", \
_("Invalid argument")); \
return -1; \
} \
@ -295,7 +295,7 @@
for (childNode = node->children; childNode != NULL; \
childNode = childNode->next) { \
if (childNode->type != XML_ELEMENT_NODE) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
virReportError(VIR_ERR_INTERNAL_ERROR, \
_("Wrong XML element type %d"), childNode->type); \
goto failure; \
} \
@ -334,7 +334,7 @@
long long value; \
\
if (number == NULL || *number != NULL) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", \
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", \
_("Invalid argument")); \
return -1; \
} \
@ -346,21 +346,21 @@
string = (char *)xmlNodeListGetString(node->doc, node->children, 1); \
\
if (string == NULL) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
virReportError(VIR_ERR_INTERNAL_ERROR, \
_("XML node doesn't contain text, expecting an %s "\
"value"), _xsdType); \
goto cleanup; \
} \
\
if (virStrToLong_ll(string, NULL, 10, &value) < 0) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
virReportError(VIR_ERR_INTERNAL_ERROR, \
_("Unknown value '%s' for %s"), string, _xsdType); \
goto cleanup; \
} \
\
if (((_min) != INT64_MIN && value < (_min)) \
|| ((_max) != INT64_MAX && value > (_max))) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
virReportError(VIR_ERR_INTERNAL_ERROR, \
_("Value '%s' is not representable as %s"), \
string, _xsdType); \
goto cleanup; \
@ -485,7 +485,7 @@
*/
#define ESX_VI__TEMPLATE__PROPERTY__REQUIRE(_name) \
if (item->_name == 0) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
virReportError(VIR_ERR_INTERNAL_ERROR, \
_("%s object is missing the required '%s' property"), \
typeName, #_name); \
return -1; \
@ -542,7 +542,7 @@
break; \
\
default: \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
virReportError(VIR_ERR_INTERNAL_ERROR, \
_("Call to %s for unexpected type '%s'"), __FUNCTION__,\
esxVI_Type_ToString(_actual_type)); \
return _error_return; \
@ -604,7 +604,7 @@
esxVI_##__type##_DynamicCast(void *item) \
{ \
if (item == NULL) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", \
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", \
_("Invalid argument")); \
return NULL; \
} \
@ -648,7 +648,7 @@
break; \
\
default: \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
virReportError(VIR_ERR_INTERNAL_ERROR, \
_("Call to %s for unexpected type '%s'"), \
__FUNCTION__, esxVI_Type_ToString(type)); \
return -1; \
@ -666,7 +666,7 @@ esxVI_GetActualObjectType(xmlNodePtr node, esxVI_Type baseType,
char *type = NULL;
if (actualType == NULL || *actualType != esxVI_Type_Undefined) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
@ -675,7 +675,7 @@ esxVI_GetActualObjectType(xmlNodePtr node, esxVI_Type baseType,
BAD_CAST "http://www.w3.org/2001/XMLSchema-instance");
if (type == NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("%s is missing 'type' property"),
esxVI_Type_ToString(baseType));
return -1;
@ -684,7 +684,7 @@ esxVI_GetActualObjectType(xmlNodePtr node, esxVI_Type baseType,
*actualType = esxVI_Type_FromString(type);
if (*actualType == esxVI_Type_Undefined) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown value '%s' for %s 'type' property"),
type, esxVI_Type_ToString(baseType));
goto cleanup;
@ -709,7 +709,7 @@ esxVI_GetActualObjectType(xmlNodePtr node, esxVI_Type baseType,
* unselected properties. */ \
if (item->_name == 0 && \
esxVI_String_ListContainsValue(selectedPropertyNameList, #_name)) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
virReportError(VIR_ERR_INTERNAL_ERROR, \
_("%s object is missing the required '%s' property"), \
typeName, #_name); \
return -1; \
@ -726,7 +726,7 @@ esxVI_GetActualObjectType(xmlNodePtr node, esxVI_Type baseType,
\
if (item->_type <= esxVI_Type_Undefined || \
item->_type >= esxVI_Type_Other) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
virReportError(VIR_ERR_INTERNAL_ERROR, \
_("%s object has invalid dynamic type"), typeName);\
return -1; \
} \
@ -866,7 +866,7 @@ int
esxVI_AnyType_ExpectType(esxVI_AnyType *anyType, esxVI_Type type)
{
if (anyType->type != type) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Expecting type '%s' but found '%s'"),
esxVI_Type_ToString(type),
anyType->type != esxVI_Type_Other
@ -882,7 +882,7 @@ int
esxVI_AnyType_DeepCopy(esxVI_AnyType **dest, esxVI_AnyType *src)
{
if (dest == NULL || *dest != NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
@ -898,7 +898,7 @@ 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, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Could not copy an XML node"));
goto failure;
}
@ -949,7 +949,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, "%s", _("Invalid argument"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
@ -960,7 +960,7 @@ esxVI_AnyType_Deserialize(xmlNodePtr node, esxVI_AnyType **anyType)
(*anyType)->node = xmlCopyNode(node, 1);
if ((*anyType)->node == NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Could not copy an XML node"));
goto failure;
}
@ -971,7 +971,7 @@ 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, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("AnyType is missing 'type' property"));
goto failure;
}
@ -979,7 +979,7 @@ esxVI_AnyType_Deserialize(xmlNodePtr node, esxVI_AnyType **anyType)
(*anyType)->type = esxVI_Type_FromString((*anyType)->other);
if ((*anyType)->type == esxVI_Type_Undefined) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown value '%s' for AnyType 'type' property"),
(*anyType)->other);
goto failure;
@ -1000,7 +1000,7 @@ esxVI_AnyType_Deserialize(xmlNodePtr node, esxVI_AnyType **anyType)
#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, \
virReportError(VIR_ERR_INTERNAL_ERROR, \
_("Unknown value '%s' for %s"), \
(*anyType)->value, _xsdType); \
goto failure; \
@ -1008,7 +1008,7 @@ esxVI_AnyType_Deserialize(xmlNodePtr node, esxVI_AnyType **anyType)
\
if (((_min) != INT64_MIN && number < (_min)) \
|| ((_max) != INT64_MAX && number > (_max))) { \
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, \
virReportError(VIR_ERR_INTERNAL_ERROR, \
_("Value '%s' is out of %s range"), \
(*anyType)->value, _xsdType); \
goto failure; \
@ -1024,7 +1024,7 @@ esxVI_AnyType_Deserialize(xmlNodePtr node, esxVI_AnyType **anyType)
} else if (STREQ((*anyType)->value, "false")) {
(*anyType)->boolean = esxVI_Boolean_False;
} else {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Unknown value '%s' for xsd:boolean"),
(*anyType)->value);
goto failure;
@ -1170,7 +1170,7 @@ int
esxVI_String_DeepCopyValue(char **dest, const char *src)
{
if (dest == NULL || *dest != NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
@ -1210,7 +1210,7 @@ esxVI_String_SerializeValue(const char *value, const char *element,
virBufferPtr output)
{
if (element == NULL || output == NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
@ -1231,7 +1231,7 @@ int
esxVI_String_Deserialize(xmlNodePtr node, esxVI_String **string)
{
if (string == NULL || *string != NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
@ -1255,7 +1255,7 @@ int
esxVI_String_DeserializeValue(xmlNodePtr node, char **value)
{
if (value == NULL || *value != NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
@ -1389,7 +1389,7 @@ int
esxVI_DateTime_Deserialize(xmlNodePtr node, esxVI_DateTime **dateTime)
{
if (dateTime == NULL || *dateTime != NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
@ -1401,7 +1401,7 @@ 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, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("XML node doesn't contain text, expecting an "
"xsd:dateTime value"));
goto failure;
@ -1429,12 +1429,12 @@ esxVI_DateTime_ConvertToCalendarTime(esxVI_DateTime *dateTime,
int tz_offset = 0;
if (dateTime == NULL || secondsSinceEpoch == NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
if (virStrcpyStatic(value, dateTime->value) == NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("xsd:dateTime value '%s' too long for destination"),
dateTime->value);
return -1;
@ -1456,7 +1456,7 @@ esxVI_DateTime_ConvertToCalendarTime(esxVI_DateTime *dateTime,
tmp = strptime(value, "%Y-%m-%dT%H:%M:%S", &tm);
if (tmp == NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("xsd:dateTime value '%s' has unexpected format"),
dateTime->value);
return -1;
@ -1466,7 +1466,7 @@ esxVI_DateTime_ConvertToCalendarTime(esxVI_DateTime *dateTime,
/* skip .ssssss part if present */
if (*tmp == '.' &&
virStrToLong_i(tmp + 1, &tmp, 10, &milliseconds) < 0) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("xsd:dateTime value '%s' has unexpected format"),
dateTime->value);
return -1;
@ -1479,7 +1479,7 @@ esxVI_DateTime_ConvertToCalendarTime(esxVI_DateTime *dateTime,
if (virStrToLong_i(tmp + 1, &tmp, 10, &tz_hours) < 0 ||
*tmp != ':' ||
virStrToLong_i(tmp + 1, NULL, 10, &tz_minutes) < 0) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("xsd:dateTime value '%s' has unexpected format"),
dateTime->value);
return -1;
@ -1493,7 +1493,7 @@ esxVI_DateTime_ConvertToCalendarTime(esxVI_DateTime *dateTime,
} else if (STREQ(tmp, "Z")) {
/* Z refers to UTC. tz_offset is already initialized to zero */
} else {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("xsd:dateTime value '%s' has unexpected format"),
dateTime->value);
return -1;
@ -1563,7 +1563,7 @@ int
esxVI_MethodFault_Deserialize(xmlNodePtr node, esxVI_MethodFault **methodFault)
{
if (methodFault == NULL || *methodFault != NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
@ -1576,7 +1576,7 @@ esxVI_MethodFault_Deserialize(xmlNodePtr node, esxVI_MethodFault **methodFault)
BAD_CAST "http://www.w3.org/2001/XMLSchema-instance");
if ((*methodFault)->_actualType == NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("MethodFault is missing 'type' property"));
goto failure;
}
@ -1629,7 +1629,7 @@ esxVI_ManagedObjectReference_Serialize
const char *element, virBufferPtr output)
{
if (element == NULL || output == NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
@ -1659,7 +1659,7 @@ esxVI_ManagedObjectReference_Deserialize
(xmlNodePtr node, esxVI_ManagedObjectReference **managedObjectReference)
{
if (managedObjectReference == NULL || *managedObjectReference != NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument"));
return -1;
}
@ -1671,7 +1671,7 @@ esxVI_ManagedObjectReference_Deserialize
(char *)xmlGetNoNsProp(node, BAD_CAST "type");
if ((*managedObjectReference)->type == NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("ManagedObjectReference is missing 'type' property"));
goto failure;
}
@ -1749,7 +1749,7 @@ ESX_VI__TEMPLATE__DESERIALIZE_EXTRA(Event, /* nothing */,
BAD_CAST "http://www.w3.org/2001/XMLSchema-instance");
if ((*ptrptr)->_actualType == NULL) {
ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("%s is missing 'type' property"),
esxVI_Type_ToString((*ptrptr)->_type));
goto failure;