From: Bihong Yu Date: Mon, 25 Oct 2021 09:04:55 +0000 (+0800) Subject: qemu_process: continue to process fakereboot after restarting libvirtd X-Git-Tag: v7.10.0-rc1~160 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3959c928ecd559e8585083380c12c9f0722d9b1;p=thirdparty%2Flibvirt.git qemu_process: continue to process fakereboot after restarting libvirtd During the vm rebooting, the vm could be paused if the libvirtd is restarted for some reason, which is not expected. We need continue fakereboot process if fakereboot flags is true and the vm is in paused-user status. Signed-off-by: Bihong Yu Reviewed-by: Michal Privoznik --- diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index be75e4d8eb..173b7d64a4 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -8732,13 +8732,15 @@ qemuProcessReconnect(void *opaque) goto error; } - /* In case the domain shutdown while we were not running, - * we need to finish the shutdown process. And we need to do it after - * we have virQEMUCaps filled in. + /* In case the domain shutdown or fake reboot while we were not running, + * we need to finish the shutdown or fake reboot process. And we need to + * do it after we have virQEMUCaps filled in. */ if (state == VIR_DOMAIN_SHUTDOWN || (state == VIR_DOMAIN_PAUSED && - reason == VIR_DOMAIN_PAUSED_SHUTTING_DOWN)) { + reason == VIR_DOMAIN_PAUSED_SHUTTING_DOWN) || + (priv->fakeReboot && state == VIR_DOMAIN_PAUSED && + reason == VIR_DOMAIN_PAUSED_USER)) { VIR_DEBUG("Finishing shutdown sequence for domain %s", obj->def->name); qemuProcessShutdownOrReboot(driver, obj);