[PATCH 3/7] virLXCProcessReboot: Simplify cleanup

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

 



Remove the pointless 'cleanup' section and 'ret' variable.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/lxc/lxc_process.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index 4934a96e0c..130c16aa04 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -89,7 +89,6 @@ virLXCProcessReboot(virLXCDriver *driver,
 {
     g_autoptr(virConnect) autoDestroyConn = virCloseCallbacksGetConn(driver->closeCallbacks, vm);
     int reason = vm->state.reason;
-    int ret = -1;
     virDomainDef *savedDef;

     VIR_DEBUG("Faking reboot");
@@ -105,15 +104,11 @@ virLXCProcessReboot(virLXCDriver *driver,
     virLXCProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_SHUTDOWN, 0);
     vm->newDef = savedDef;
     if (virLXCProcessStart(driver, vm, 0, NULL, autoDestroyConn, reason) < 0) {
-        VIR_WARN("Unable to handle reboot of vm %s",
-                 vm->def->name);
-        goto cleanup;
+        VIR_WARN("Unable to handle reboot of vm %s", vm->def->name);
+        return -1;
     }

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


-- 
2.36.1




[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