[PATCH 54/55] hyperv: use g_auto for WsXmlDocH in hypervDomainAttachVirtualDisk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Matt Coleman <matt@xxxxxxxxx>
---
 src/hyperv/hyperv_driver.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c
index 2c0e9e0614..b81cedf426 100644
--- a/src/hyperv/hyperv_driver.c
+++ b/src/hyperv/hyperv_driver.c
@@ -496,9 +496,8 @@ hypervDomainAttachVirtualDisk(virDomainPtr domain,
                               Msvm_ResourceAllocationSettingData *controller,
                               const char *hostname)
 {
-    int result = -1;
     g_autofree char *parentInstanceID = NULL;
-    WsXmlDocH response = NULL;
+    g_auto(WsXmlDocH) response = NULL;
 
     VIR_DEBUG("Now attaching disk image '%s' with address %d to bus %d of type %d",
               disk->src->path, disk->info.addr.drive.unit, disk->info.addr.drive.controller, disk->bus);
@@ -513,17 +512,12 @@ hypervDomainAttachVirtualDisk(virDomainPtr domain,
 
     parentInstanceID = hypervGetInstanceIDFromXMLResponse(response);
     if (!parentInstanceID)
-        goto cleanup;
+        return -1;
 
     if (hypervDomainAddVirtualHardDisk(domain, disk, hostname, parentInstanceID) < 0)
-        goto cleanup;
-
-    result = 0;
-
- cleanup:
-    ws_xml_destroy_doc(response);
+        return -1;
 
-    return result;
+    return 0;
 }
 
 
-- 
2.30.0





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux