From: Zhenzhong Duan Date: Sun, 26 Sep 2021 09:06:38 +0000 (+0800) Subject: qemu: ingore the transient domain state in fake reboot X-Git-Tag: v7.8.0-rc1~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=88a397792233b5084c8b0594c34f505d8f42a461;p=thirdparty%2Flibvirt.git qemu: ingore the transient domain state in fake reboot When action for 'on_poweroff' is set to 'restart', 'fake reboot' is triggered and qemu shutdown state is transient. Domain state need not to be changed and events not sent in this case. Fixes: 4ffc807214cb80086d57e1d3e7b60959a41d2874 Signed-off-by: Zhenzhong Duan Reviewed-by: Michal Privoznik --- diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 632cb817b9..fcdda4ffe1 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -612,7 +612,7 @@ qemuProcessHandleShutdown(qemuMonitor *mon G_GNUC_UNUSED, /* In case of fake reboot qemu shutdown state is transient so don't * change domain state nor send events. */ - if (!priv->fakeReboot || + if (!priv->fakeReboot && vm->def->onPoweroff != VIR_DOMAIN_LIFECYCLE_ACTION_RESTART) { VIR_DEBUG("Transitioned guest %s to shutdown state", vm->def->name);