From: Peter Krempa Date: Tue, 28 Jun 2022 14:32:12 +0000 (+0200) Subject: virLXCProcessReboot: Simplify cleanup X-Git-Tag: v8.6.0-rc1~37 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5b15917730e7667cbd494de672162fbaa2c61336;p=thirdparty%2Flibvirt.git virLXCProcessReboot: Simplify cleanup Remove the pointless 'cleanup' section and 'ret' variable. Signed-off-by: Peter Krempa Reviewed-by: Tim Wiederhake --- 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; }