[PATCH 06/10] qemu: command: get rid of 'cleanup' in qemuBuildDiskSourceCommandLine

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

 



Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_command.c | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 1ae8a00352..7a7497686a 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -2563,43 +2563,37 @@ qemuBuildDiskSourceCommandLine(virCommandPtr cmd,
     VIR_AUTOPTR(virJSONValue) copyOnReadProps = NULL;
     VIR_AUTOFREE(char *) copyOnReadPropsStr = NULL;
     size_t i;
-    int ret = -1;

     if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) {
-        if (virStorageSourceIsEmpty(disk->src)) {
-            ret = 0;
-            goto cleanup;
-        }
+        if (virStorageSourceIsEmpty(disk->src))
+            return 0;

         if (!(data = qemuBuildStorageSourceChainAttachPrepareBlockdev(disk->src,
                                                                       qemuCaps)))
-            goto cleanup;
+            return -1;

         if (disk->copy_on_read == VIR_TRISTATE_SWITCH_ON &&
             !(copyOnReadProps = qemuBlockStorageGetCopyOnReadProps(disk)))
-            goto cleanup;
+            return -1;
     } else {
         if (!(data = qemuBuildStorageSourceChainAttachPrepareDrive(disk, qemuCaps)))
-            goto cleanup;
+            return -1;
     }

     for (i = data->nsrcdata; i > 0; i--) {
         if (qemuBuildBlockStorageSourceAttachDataCommandline(cmd,
                                                              data->srcdata[i - 1]) < 0)
-            goto cleanup;
+            return -1;
     }

     if (copyOnReadProps) {
         if (!(copyOnReadPropsStr = virJSONValueToString(copyOnReadProps, false)))
-            goto cleanup;
+            return -1;

         virCommandAddArgList(cmd, "-blockdev", copyOnReadPropsStr, NULL);
     }

-    ret = 0;
-
- cleanup:
-    return ret;
+    return 0;
 }


-- 
2.21.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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