[PATCH] qemu: ingore the transient domain state in fake reboot

Zhenzhong Duan posted 1 patch 2 years, 7 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20210926090638.160157-1-zhenzhong.duan@intel.com
src/qemu/qemu_process.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] qemu: ingore the transient domain state in fake reboot
Posted by Zhenzhong Duan 2 years, 7 months ago
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>
---
 src/qemu/qemu_process.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
-- 
2.25.1

Re: [PATCH] qemu: ingore the transient domain state in fake reboot
Posted by Michal Prívozník 2 years, 7 months ago
On 9/26/21 11:06 AM, Zhenzhong Duan wrote:
> 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>
> ---
>  src/qemu/qemu_process.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

and pushed.

Michal