[PATCH v4 4/4] qemu_process.c: remove 'cleanup' label from qemuProcessCreatePretendCmd()

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

 



The 'cleanup' flag is doing no cleaup in this function. We can
remove it and return NULL on error or qemuBuildCommandLine().

Signed-off-by: Daniel Henrique Barboza <danielhb413@xxxxxxxxx>
---

As mentioned in the cover, sending this one in its own
patch simply because it is not related to the cleanup
made in this series - I spotted by code inspection. The
maintainer is welcome to squash this one in the previous
patch.

 src/qemu/qemu_process.c | 37 ++++++++++++++++---------------------
 1 file changed, 16 insertions(+), 21 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 184bd6e816..2a629c0de7 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -7152,11 +7152,9 @@ qemuProcessCreatePretendCmd(virQEMUDriverPtr driver,
                             bool standalone,
                             unsigned int flags)
 {
-    virCommandPtr cmd = NULL;
-
-    virCheckFlagsGoto(VIR_QEMU_PROCESS_START_COLD |
-                      VIR_QEMU_PROCESS_START_PAUSED |
-                      VIR_QEMU_PROCESS_START_AUTODESTROY, cleanup);
+    virCheckFlags(VIR_QEMU_PROCESS_START_COLD |
+                  VIR_QEMU_PROCESS_START_PAUSED |
+                  VIR_QEMU_PROCESS_START_AUTODESTROY, NULL);
 
     flags |= VIR_QEMU_PROCESS_START_PRETEND;
     flags |= VIR_QEMU_PROCESS_START_NEW;
@@ -7165,26 +7163,23 @@ qemuProcessCreatePretendCmd(virQEMUDriverPtr driver,
 
     if (qemuProcessInit(driver, vm, NULL, QEMU_ASYNC_JOB_NONE,
                         !!migrateURI, flags) < 0)
-        goto cleanup;
+        return NULL;
 
     if (qemuProcessPrepareDomain(driver, vm, flags) < 0)
-        goto cleanup;
+        return NULL;
 
     VIR_DEBUG("Building emulator command line");
-    cmd = qemuBuildCommandLine(driver,
-                               NULL,
-                               driver->securityManager,
-                               vm,
-                               migrateURI,
-                               NULL,
-                               VIR_NETDEV_VPORT_PROFILE_OP_NO_OP,
-                               standalone,
-                               enableFips,
-                               NULL,
-                               NULL);
-
- cleanup:
-    return cmd;
+    return qemuBuildCommandLine(driver,
+                                NULL,
+                                driver->securityManager,
+                                vm,
+                                migrateURI,
+                                NULL,
+                                VIR_NETDEV_VPORT_PROFILE_OP_NO_OP,
+                                standalone,
+                                enableFips,
+                                NULL,
+                                NULL);
 }
 
 
-- 
2.23.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