mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-18 10:35:20 +00:00
virLXCProcessReboot: Simplify cleanup
Remove the pointless 'cleanup' section and 'ret' variable. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
This commit is contained in:
parent
ed0507b58a
commit
5b15917730
@ -89,7 +89,6 @@ virLXCProcessReboot(virLXCDriver *driver,
|
|||||||
{
|
{
|
||||||
g_autoptr(virConnect) autoDestroyConn = virCloseCallbacksGetConn(driver->closeCallbacks, vm);
|
g_autoptr(virConnect) autoDestroyConn = virCloseCallbacksGetConn(driver->closeCallbacks, vm);
|
||||||
int reason = vm->state.reason;
|
int reason = vm->state.reason;
|
||||||
int ret = -1;
|
|
||||||
virDomainDef *savedDef;
|
virDomainDef *savedDef;
|
||||||
|
|
||||||
VIR_DEBUG("Faking reboot");
|
VIR_DEBUG("Faking reboot");
|
||||||
@ -105,15 +104,11 @@ virLXCProcessReboot(virLXCDriver *driver,
|
|||||||
virLXCProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_SHUTDOWN, 0);
|
virLXCProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_SHUTDOWN, 0);
|
||||||
vm->newDef = savedDef;
|
vm->newDef = savedDef;
|
||||||
if (virLXCProcessStart(driver, vm, 0, NULL, autoDestroyConn, reason) < 0) {
|
if (virLXCProcessStart(driver, vm, 0, NULL, autoDestroyConn, reason) < 0) {
|
||||||
VIR_WARN("Unable to handle reboot of vm %s",
|
VIR_WARN("Unable to handle reboot of vm %s", vm->def->name);
|
||||||
vm->def->name);
|
return -1;
|
||||||
goto cleanup;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
return 0;
|
||||||
|
|
||||||
cleanup:
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user