]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: ingore the transient domain state in fake reboot
authorZhenzhong Duan <zhenzhong.duan@intel.com>
Sun, 26 Sep 2021 09:06:38 +0000 (17:06 +0800)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 27 Sep 2021 07:53:20 +0000 (09:53 +0200)
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 <zhenzhong.duan@intel.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_process.c

index 632cb817b96f33dd62282d6c0c6e87ddb0113f88..fcdda4ffe1b82a8683b1b2e897d3716dc131c5d8 100644 (file)
@@ -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);