From: "Daniel P. Berrange" <berrange(a)redhat.com>
Update the Hyper-V driver to use virReportError instead
of the HYPERV_ERROR custom macro
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
cfg.mk | 1 -
src/hyperv/hyperv_driver.c | 142 +++++++++++++++++++++----------------------
src/hyperv/hyperv_private.h | 4 --
src/hyperv/hyperv_util.c | 10 +--
src/hyperv/hyperv_wmi.c | 114 +++++++++++++++++-----------------
5 files changed, 133 insertions(+), 138 deletions(-)
diff --git a/cfg.mk b/cfg.mk
index 5e8958b..d7691a3 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -506,7 +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 += HYPERV_ERROR
msg_gen_function += PHYP_ERROR
msg_gen_function += VIR_ERROR
msg_gen_function += VMX_ERROR
diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c
index 3b15292..17685ea 100644
--- a/src/hyperv/hyperv_driver.c
+++ b/src/hyperv/hyperv_driver.c
@@ -96,23 +96,23 @@ hypervOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int
flags)
return VIR_DRV_OPEN_DECLINED;
}
- HYPERV_ERROR(VIR_ERR_INVALID_ARG,
- _("Transport '%s' in URI scheme is not supported, try
again "
- "without the transport part"), plus + 1);
+ 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;
}
/* Require server part */
if (conn->uri->server == NULL) {
- HYPERV_ERROR(VIR_ERR_INVALID_ARG, "%s",
- _("URI is missing the server part"));
+ 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) {
- HYPERV_ERROR(VIR_ERR_INVALID_ARG, "%s",
- _("Missing or invalid auth pointer"));
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
+ _("Missing or invalid auth pointer"));
return VIR_DRV_OPEN_ERROR;
}
@@ -150,7 +150,7 @@ hypervOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int
flags)
username = virAuthGetUsername(conn, auth, "hyperv",
"administrator", conn->uri->server);
if (username == NULL) {
- HYPERV_ERROR(VIR_ERR_AUTH_FAILED, "%s", _("Username request
failed"));
+ virReportError(VIR_ERR_AUTH_FAILED, "%s", _("Username request
failed"));
goto cleanup;
}
}
@@ -158,7 +158,7 @@ hypervOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int
flags)
password = virAuthGetPassword(conn, auth, "hyperv", username,
conn->uri->server);
if (password == NULL) {
- HYPERV_ERROR(VIR_ERR_AUTH_FAILED, "%s", _("Password request
failed"));
+ virReportError(VIR_ERR_AUTH_FAILED, "%s", _("Password request
failed"));
goto cleanup;
}
@@ -167,14 +167,14 @@ hypervOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int
flags)
priv->parsedUri->transport, username, password);
if (priv->client == NULL) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Could not create openwsman client"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Could not create openwsman client"));
goto cleanup;
}
if (wsmc_transport_init(priv->client, NULL) != 0) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Could not initialize openwsman transport"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Could not initialize openwsman transport"));
goto cleanup;
}
@@ -194,8 +194,8 @@ hypervOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int
flags)
}
if (computerSystem == NULL) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("%s is not a Hyper-V server"),
conn->uri->server);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("%s is not a Hyper-V server"),
conn->uri->server);
goto cleanup;
}
@@ -254,9 +254,9 @@ hypervGetHostname(virConnectPtr conn)
}
if (computerSystem == NULL) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Could not lookup %s"),
- "Win32_ComputerSystem");
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not lookup %s"),
+ "Win32_ComputerSystem");
goto cleanup;
}
@@ -296,9 +296,9 @@ hypervNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info)
}
if (computerSystem == NULL) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Could not lookup %s"),
- "Win32_ComputerSystem");
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not lookup %s"),
+ "Win32_ComputerSystem");
goto cleanup;
}
@@ -315,9 +315,9 @@ hypervNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info)
}
if (processorList == NULL) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Could not lookup %s"),
- "Win32_Processor");
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not lookup %s"),
+ "Win32_Processor");
goto cleanup;
}
@@ -342,9 +342,9 @@ hypervNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info)
/* Fill struct */
if (virStrncpy(info->model, processorList->data->Name,
sizeof(info->model) - 1, sizeof(info->model)) == NULL) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("CPU model %s too long for destination"),
- processorList->data->Name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("CPU model %s too long for destination"),
+ processorList->data->Name);
goto cleanup;
}
@@ -471,7 +471,7 @@ hypervDomainLookupByID(virConnectPtr conn, int id)
}
if (computerSystem == NULL) {
- HYPERV_ERROR(VIR_ERR_NO_DOMAIN, _("No domain with ID %d"), id);
+ virReportError(VIR_ERR_NO_DOMAIN, _("No domain with ID %d"), id);
goto cleanup;
}
@@ -506,8 +506,8 @@ hypervDomainLookupByUUID(virConnectPtr conn, const unsigned char
*uuid)
}
if (computerSystem == NULL) {
- HYPERV_ERROR(VIR_ERR_NO_DOMAIN,
- _("No domain with UUID %s"), uuid_string);
+ virReportError(VIR_ERR_NO_DOMAIN,
+ _("No domain with UUID %s"), uuid_string);
goto cleanup;
}
@@ -539,8 +539,8 @@ hypervDomainLookupByName(virConnectPtr conn, const char *name)
}
if (computerSystem == NULL) {
- HYPERV_ERROR(VIR_ERR_NO_DOMAIN,
- _("No domain with name %s"), name);
+ virReportError(VIR_ERR_NO_DOMAIN,
+ _("No domain with name %s"), name);
goto cleanup;
}
@@ -567,8 +567,8 @@ hypervDomainSuspend(virDomainPtr domain)
if (computerSystem->data->EnabledState !=
MSVM_COMPUTERSYSTEM_ENABLEDSTATE_ENABLED) {
- HYPERV_ERROR(VIR_ERR_OPERATION_INVALID, "%s",
- _("Domain is not active"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("Domain is not active"));
goto cleanup;
}
@@ -596,8 +596,8 @@ hypervDomainResume(virDomainPtr domain)
if (computerSystem->data->EnabledState !=
MSVM_COMPUTERSYSTEM_ENABLEDSTATE_PAUSED) {
- HYPERV_ERROR(VIR_ERR_OPERATION_INVALID, "%s",
- _("Domain is not paused"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("Domain is not paused"));
goto cleanup;
}
@@ -628,8 +628,8 @@ hypervDomainDestroyFlags(virDomainPtr domain, unsigned int flags)
if (!hypervIsMsvmComputerSystemActive(computerSystem, &in_transition) ||
in_transition) {
- HYPERV_ERROR(VIR_ERR_OPERATION_INVALID, "%s",
- _("Domain is not active or is in state transition"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("Domain is not active or is in state transition"));
goto cleanup;
}
@@ -703,10 +703,10 @@ hypervDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info)
}
if (virtualSystemSettingData == NULL) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Could not lookup %s for domain %s"),
- "Msvm_VirtualSystemSettingData",
- computerSystem->data->ElementName);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not lookup %s for domain %s"),
+ "Msvm_VirtualSystemSettingData",
+ computerSystem->data->ElementName);
goto cleanup;
}
@@ -724,10 +724,10 @@ hypervDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info)
}
if (processorSettingData == NULL) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Could not lookup %s for domain %s"),
- "Msvm_ProcessorSettingData",
- computerSystem->data->ElementName);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not lookup %s for domain %s"),
+ "Msvm_ProcessorSettingData",
+ computerSystem->data->ElementName);
goto cleanup;
}
@@ -746,10 +746,10 @@ hypervDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info)
if (memorySettingData == NULL) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Could not lookup %s for domain %s"),
- "Msvm_MemorySettingData",
- computerSystem->data->ElementName);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not lookup %s for domain %s"),
+ "Msvm_MemorySettingData",
+ computerSystem->data->ElementName);
goto cleanup;
}
@@ -845,10 +845,10 @@ hypervDomainGetXMLDesc(virDomainPtr domain, unsigned int flags)
}
if (virtualSystemSettingData == NULL) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Could not lookup %s for domain %s"),
- "Msvm_VirtualSystemSettingData",
- computerSystem->data->ElementName);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not lookup %s for domain %s"),
+ "Msvm_VirtualSystemSettingData",
+ computerSystem->data->ElementName);
goto cleanup;
}
@@ -866,10 +866,10 @@ hypervDomainGetXMLDesc(virDomainPtr domain, unsigned int flags)
}
if (processorSettingData == NULL) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Could not lookup %s for domain %s"),
- "Msvm_ProcessorSettingData",
- computerSystem->data->ElementName);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not lookup %s for domain %s"),
+ "Msvm_ProcessorSettingData",
+ computerSystem->data->ElementName);
goto cleanup;
}
@@ -888,10 +888,10 @@ hypervDomainGetXMLDesc(virDomainPtr domain, unsigned int flags)
if (memorySettingData == NULL) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Could not lookup %s for domain %s"),
- "Msvm_MemorySettingData",
- computerSystem->data->ElementName);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not lookup %s for domain %s"),
+ "Msvm_MemorySettingData",
+ computerSystem->data->ElementName);
goto cleanup;
}
@@ -905,9 +905,9 @@ hypervDomainGetXMLDesc(virDomainPtr domain, unsigned int flags)
}
if (virUUIDParse(computerSystem->data->Name, def->uuid) < 0) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Could not parse UUID from string '%s'"),
- computerSystem->data->Name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not parse UUID from string '%s'"),
+ computerSystem->data->Name);
return NULL;
}
@@ -1066,8 +1066,8 @@ hypervDomainCreateWithFlags(virDomainPtr domain, unsigned int
flags)
}
if (hypervIsMsvmComputerSystemActive(computerSystem, NULL)) {
- HYPERV_ERROR(VIR_ERR_OPERATION_INVALID, "%s",
- _("Domain is already active or is in state transition"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("Domain is already active or is in state
transition"));
goto cleanup;
}
@@ -1189,8 +1189,8 @@ hypervDomainManagedSave(virDomainPtr domain, unsigned int flags)
if (!hypervIsMsvmComputerSystemActive(computerSystem, &in_transition) ||
in_transition) {
- HYPERV_ERROR(VIR_ERR_OPERATION_INVALID, "%s",
- _("Domain is not active or is in state transition"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("Domain is not active or is in state transition"));
goto cleanup;
}
@@ -1244,8 +1244,8 @@ hypervDomainManagedSaveRemove(virDomainPtr domain, unsigned int
flags)
if (computerSystem->data->EnabledState !=
MSVM_COMPUTERSYSTEM_ENABLEDSTATE_SUSPENDED) {
- HYPERV_ERROR(VIR_ERR_OPERATION_INVALID, "%s",
- _("Domain has no managed save image"));
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("Domain has no managed save image"));
goto cleanup;
}
diff --git a/src/hyperv/hyperv_private.h b/src/hyperv/hyperv_private.h
index ebddf5d..677c5bc 100644
--- a/src/hyperv/hyperv_private.h
+++ b/src/hyperv/hyperv_private.h
@@ -29,10 +29,6 @@
# include "hyperv_util.h"
# include "openwsman.h"
-# define HYPERV_ERROR(code, ...) \
- virReportErrorHelper(VIR_FROM_HYPERV, code, __FILE__, __FUNCTION__, \
- __LINE__, __VA_ARGS__)
-
typedef struct _hypervPrivate hypervPrivate;
struct _hypervPrivate {
diff --git a/src/hyperv/hyperv_util.c b/src/hyperv/hyperv_util.c
index 81c087e..86d140f 100644
--- a/src/hyperv/hyperv_util.c
+++ b/src/hyperv/hyperv_util.c
@@ -42,7 +42,7 @@ hypervParseUri(hypervParsedUri **parsedUri, virURIPtr uri)
int i;
if (parsedUri == NULL || *parsedUri != NULL) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid
argument"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid
argument"));
return -1;
}
@@ -66,10 +66,10 @@ hypervParseUri(hypervParsedUri **parsedUri, virURIPtr uri)
if (STRNEQ((*parsedUri)->transport, "http") &&
STRNEQ((*parsedUri)->transport, "https")) {
- HYPERV_ERROR(VIR_ERR_INVALID_ARG,
- _("Query parameter 'transport' has unexpected
value "
- "'%s' (should be http|https)"),
- (*parsedUri)->transport);
+ virReportError(VIR_ERR_INVALID_ARG,
+ _("Query parameter 'transport' has unexpected
value "
+ "'%s' (should be http|https)"),
+ (*parsedUri)->transport);
goto cleanup;
}
} else {
diff --git a/src/hyperv/hyperv_wmi.c b/src/hyperv/hyperv_wmi.c
index 517c8ea..4a2dfff 100644
--- a/src/hyperv/hyperv_wmi.c
+++ b/src/hyperv/hyperv_wmi.c
@@ -56,25 +56,25 @@ hyperyVerifyResponse(WsManClient *client, WsXmlDocH response,
WsManFault *fault;
if (lastError != WS_LASTERR_OK) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Transport error during %s: %s (%d)"),
- detail, wsman_transport_get_last_error_string(lastError),
- lastError);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Transport error during %s: %s (%d)"),
+ detail, wsman_transport_get_last_error_string(lastError),
+ lastError);
return -1;
}
/* Check the HTTP response code and report an error if it's not 200 (OK),
* 400 (Bad Request) or 500 (Internal Server Error) */
if (responseCode != 200 && responseCode != 400 && responseCode !=
500) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Unexpected HTTP response during %s: %d"),
- detail, responseCode);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Unexpected HTTP response during %s: %d"),
+ detail, responseCode);
return -1;
}
if (response == NULL) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Empty response during %s"), detail);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Empty response during %s"), detail);
return -1;
}
@@ -88,11 +88,11 @@ hyperyVerifyResponse(WsManClient *client, WsXmlDocH response,
wsmc_get_fault_data(response, fault);
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("SOAP fault during %s: code '%s', subcode
'%s', "
- "reason '%s', detail '%s'"),
- detail, NULLSTR(fault->code), NULLSTR(fault->subcode),
- NULLSTR(fault->reason), NULLSTR(fault->fault_detail));
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("SOAP fault during %s: code '%s', subcode
'%s', "
+ "reason '%s', detail '%s'"),
+ detail, NULLSTR(fault->code), NULLSTR(fault->subcode),
+ NULLSTR(fault->reason), NULLSTR(fault->fault_detail));
wsmc_fault_destroy(fault);
return -1;
@@ -126,7 +126,7 @@ hypervEnumAndPull(hypervPrivate *priv, virBufferPtr query, const char
*root,
hypervObject *object;
if (list == NULL || *list != NULL) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid
argument"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid
argument"));
return -1;
}
@@ -140,8 +140,8 @@ hypervEnumAndPull(hypervPrivate *priv, virBufferPtr query, const char
*root,
options = wsmc_options_init();
if (options == NULL) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Could not initialize options"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Could not initialize options"));
goto cleanup;
}
@@ -149,8 +149,8 @@ hypervEnumAndPull(hypervPrivate *priv, virBufferPtr query, const char
*root,
filter = filter_create_simple(WSM_WQL_FILTER_DIALECT, query_string);
if (filter == NULL) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Could not create filter"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Could not create filter"));
goto cleanup;
}
@@ -176,24 +176,24 @@ hypervEnumAndPull(hypervPrivate *priv, virBufferPtr query, const
char *root,
node = ws_xml_get_soap_body(response);
if (node == NULL) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Could not lookup SOAP body"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Could not lookup SOAP body"));
goto cleanup;
}
node = ws_xml_get_child(node, 0, XML_NS_ENUMERATION, WSENUM_PULL_RESP);
if (node == NULL) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Could not lookup pull response"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Could not lookup pull response"));
goto cleanup;
}
node = ws_xml_get_child(node, 0, XML_NS_ENUMERATION, WSENUM_ITEMS);
if (node == NULL) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Could not lookup pull response items"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Could not lookup pull response items"));
goto cleanup;
}
@@ -205,8 +205,8 @@ hypervEnumAndPull(hypervPrivate *priv, virBufferPtr query, const char
*root,
className, resourceUri, NULL, 0, 0);
if (data == NULL) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Could not deserialize pull response item"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Could not deserialize pull response item"));
goto cleanup;
}
@@ -422,8 +422,8 @@ hypervInvokeMsvmComputerSystemRequestStateChange(virDomainPtr domain,
options = wsmc_options_init();
if (options == NULL) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Could not initialize options"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Could not initialize options"));
goto cleanup;
}
@@ -442,15 +442,15 @@ hypervInvokeMsvmComputerSystemRequestStateChange(virDomainPtr
domain,
returnValue = ws_xml_get_xpath_value(response, (char
*)"/s:Envelope/s:Body/p:RequestStateChange_OUTPUT/p:ReturnValue");
if (returnValue == NULL) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Could not lookup %s for %s invocation"),
- "ReturnValue", "RequestStateChange");
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not lookup %s for %s invocation"),
+ "ReturnValue", "RequestStateChange");
goto cleanup;
}
if (virStrToLong_i(returnValue, NULL, 10, &returnCode) < 0) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Could not parse return code from '%s'"),
returnValue);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not parse return code from '%s'"),
returnValue);
goto cleanup;
}
@@ -459,9 +459,9 @@ hypervInvokeMsvmComputerSystemRequestStateChange(virDomainPtr domain,
instanceID = ws_xml_get_xpath_value(response, (char
*)"/s:Envelope/s:Body/p:RequestStateChange_OUTPUT/p:Job/a:ReferenceParameters/w:SelectorSet/w:Selector[@Name='InstanceID']");
if (instanceID == NULL) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Could not lookup %s for %s invocation"),
- "InstanceID", "RequestStateChange");
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not lookup %s for %s invocation"),
+ "InstanceID", "RequestStateChange");
goto cleanup;
}
@@ -476,9 +476,9 @@ hypervInvokeMsvmComputerSystemRequestStateChange(virDomainPtr domain,
}
if (concreteJob == NULL) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Could not lookup %s for %s invocation"),
- "Msvm_ConcreteJob",
"RequestStateChange");
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not lookup %s for %s invocation"),
+ "Msvm_ConcreteJob",
"RequestStateChange");
goto cleanup;
}
@@ -501,23 +501,23 @@ hypervInvokeMsvmComputerSystemRequestStateChange(virDomainPtr
domain,
case MSVM_CONCRETEJOB_JOBSTATE_KILLED:
case MSVM_CONCRETEJOB_JOBSTATE_EXCEPTION:
case MSVM_CONCRETEJOB_JOBSTATE_SERVICE:
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Concrete job for %s invocation is in error
state"),
- "RequestStateChange");
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Concrete job for %s invocation is in error
state"),
+ "RequestStateChange");
goto cleanup;
default:
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Concrete job for %s invocation is in unknown
state"),
- "RequestStateChange");
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Concrete job for %s invocation is in unknown
state"),
+ "RequestStateChange");
goto cleanup;
}
}
} else if (returnCode != CIM_RETURNCODE_COMPLETED_WITH_NO_ERROR) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Invocation of %s returned an error: %s (%d)"),
- "RequestStateChange",
hypervReturnCodeToString(returnCode),
- returnCode);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Invocation of %s returned an error: %s (%d)"),
+ "RequestStateChange",
hypervReturnCodeToString(returnCode),
+ returnCode);
goto cleanup;
}
@@ -624,14 +624,14 @@ hypervMsvmComputerSystemToDomain(virConnectPtr conn,
unsigned char uuid[VIR_UUID_BUFLEN];
if (domain == NULL || *domain != NULL) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid
argument"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid
argument"));
return -1;
}
if (virUUIDParse(computerSystem->data->Name, uuid) < 0) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR,
- _("Could not parse UUID from string '%s'"),
- computerSystem->data->Name);
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not parse UUID from string '%s'"),
+ computerSystem->data->Name);
return -1;
}
@@ -659,7 +659,7 @@ hypervMsvmComputerSystemFromDomain(virDomainPtr domain,
virBuffer query = VIR_BUFFER_INITIALIZER;
if (computerSystem == NULL || *computerSystem != NULL) {
- HYPERV_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid
argument"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid
argument"));
return -1;
}
@@ -675,8 +675,8 @@ hypervMsvmComputerSystemFromDomain(virDomainPtr domain,
}
if (*computerSystem == NULL) {
- HYPERV_ERROR(VIR_ERR_NO_DOMAIN,
- _("No domain with UUID %s"), uuid_string);
+ virReportError(VIR_ERR_NO_DOMAIN,
+ _("No domain with UUID %s"), uuid_string);
return -1;
}
--
1.7.10.4