mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 20:45:18 +00:00
qemu_process: set fakereboot flags false after processing fakereboot over
During the vm rebooting, the vm could be shut down if the libvirtd is restarted for some reason, which is not expected. We move set fakereboot flags false after processing fakereboot over, so we can ensure that fakereboot process have been executed. Signed-off-by: Bihong Yu <yubihong@huawei.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
1780a49d7f
commit
83ce9ec0a7
@ -523,6 +523,7 @@ qemuProcessFakeReboot(void *opaque)
|
||||
|
||||
cleanup:
|
||||
priv->pausedShutdown = false;
|
||||
qemuDomainSetFakeReboot(driver, vm, false);
|
||||
if (ret == -1)
|
||||
ignore_value(qemuProcessKill(vm, VIR_QEMU_PROCESS_KILL_FORCE));
|
||||
virDomainObjEndAPI(&vm);
|
||||
@ -540,7 +541,6 @@ qemuProcessShutdownOrReboot(virQEMUDriver *driver,
|
||||
g_autofree char *name = g_strdup_printf("reboot-%s", vm->def->name);
|
||||
virThread th;
|
||||
|
||||
qemuDomainSetFakeReboot(driver, vm, false);
|
||||
virObjectRef(vm);
|
||||
if (virThreadCreateFull(&th,
|
||||
false,
|
||||
@ -551,6 +551,7 @@ qemuProcessShutdownOrReboot(virQEMUDriver *driver,
|
||||
VIR_ERROR(_("Failed to create reboot thread, killing domain"));
|
||||
ignore_value(qemuProcessKill(vm, VIR_QEMU_PROCESS_KILL_NOWAIT));
|
||||
priv->pausedShutdown = false;
|
||||
qemuDomainSetFakeReboot(driver, vm, false);
|
||||
virObjectUnref(vm);
|
||||
}
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user