}
}
- if (virAsprintf(&selector,
- "CreationClassName=Msvm_Keyboard&DeviceID=%s&"
- "SystemCreationClassName=Msvm_ComputerSystem&"
- "SystemName=%s", keyboard->data.common->DeviceID, uuid_string) < 0)
- goto cleanup;
+ selector = g_strdup_printf("CreationClassName=Msvm_Keyboard&DeviceID=%s&"
+ "SystemCreationClassName=Msvm_ComputerSystem&"
+ "SystemName=%s", keyboard->data.common->DeviceID, uuid_string);
/* press the keys */
for (i = 0; i < nkeycodes; i++) {
virCheckFlags(0, -1);
- if (virAsprintf(&memory_str, "%lu", memory_mb) < 0)
- goto cleanup;
+ memory_str = g_strdup_printf("%lu", memory_mb);
virUUIDFormat(domain->uuid, uuid_string);
char *method = NULL;
WsXmlNodeH xmlNodeMethod = NULL;
- if (virAsprintf(&method, "%s_INPUT", params->method) < 0)
- goto cleanup;
+ method = g_strdup_printf("%s_INPUT", params->method);
*docRoot = ws_xml_create_doc(NULL, method);
if (*docRoot == NULL) {
params->method, paramsDocRoot);
/* check return code of invocation */
- if (virAsprintf(&returnValue_xpath, "/s:Envelope/s:Body/p:%s_OUTPUT/p:ReturnValue",
- params->method) < 0)
- goto cleanup;
+ returnValue_xpath = g_strdup_printf("/s:Envelope/s:Body/p:%s_OUTPUT/p:ReturnValue",
+ params->method);
returnValue = ws_xml_get_xpath_value(response, returnValue_xpath);
if (!returnValue) {
goto cleanup;
if (returnCode == CIM_RETURNCODE_TRANSITION_STARTED) {
- if (virAsprintf(&jobcode_instance_xpath,
- "/s:Envelope/s:Body/p:%s_OUTPUT/p:Job/a:ReferenceParameters/"
- "w:SelectorSet/w:Selector[@Name='InstanceID']",
- params->method) < 0) {
- goto cleanup;
- }
+ jobcode_instance_xpath = g_strdup_printf("/s:Envelope/s:Body/p:%s_OUTPUT/p:Job/a:ReferenceParameters/"
+ "w:SelectorSet/w:Selector[@Name='InstanceID']",
+ params->method);
instanceID = ws_xml_get_xpath_value(response, jobcode_instance_xpath);
if (!instanceID) {
virUUIDFormat(domain->uuid, uuid_string);
- if (virAsprintf(&selector, "Name=%s&CreationClassName=Msvm_ComputerSystem",
- uuid_string) < 0 ||
- virAsprintf(&properties, "RequestedState=%d", requestedState) < 0)
- goto cleanup;
+ selector = g_strdup_printf("Name=%s&CreationClassName=Msvm_ComputerSystem", uuid_string);
+ properties = g_strdup_printf("RequestedState=%d", requestedState);
if (priv->wmiVersion == HYPERV_WMI_VERSION_V1)
resourceUri = MSVM_COMPUTERSYSTEM_V1_RESOURCE_URI;