render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
9c6c51
From f1857a275fc589565d1665c1a7239911ec72b9da Mon Sep 17 00:00:00 2001
9c6c51
Message-Id: <f1857a275fc589565d1665c1a7239911ec72b9da@dist-git>
9c6c51
From: Jiri Denemark <jdenemar@redhat.com>
9c6c51
Date: Wed, 7 Nov 2018 14:34:52 +0100
9c6c51
Subject: [PATCH] qemu: Don't ignore resume events
9c6c51
9c6c51
Since commit v4.7.0-302-ge6d77a75c4 processing RESUME event is mandatory
9c6c51
for updating domain state. But the event handler explicitly ignored this
9c6c51
event in some cases. Thus the state would be wrong after a fake reboot
9c6c51
or when a domain was rebooted after it crashed.
9c6c51
9c6c51
BTW, the code to ignore RESUME event after SHUTDOWN didn't make sense
9c6c51
even before making RESUME event mandatory. Most likely it was there as a
9c6c51
result of careless copy&paste from qemuProcessHandleStop.
9c6c51
9c6c51
The corresponding debug message was clarified since the original state
9c6c51
does not have to be "paused" only and while we have a "resumed" event,
9c6c51
the state is called "running".
9c6c51
9c6c51
https://bugzilla.redhat.com/show_bug.cgi?id=1612943
9c6c51
9c6c51
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9c6c51
(cherry picked from commit e47949357ba268e7e8c3adea7c262b84fa002302)
9c6c51
9c6c51
https://bugzilla.redhat.com/show_bug.cgi?id=1634759
9c6c51
https://bugzilla.redhat.com/show_bug.cgi?id=1634758
9c6c51
https://bugzilla.redhat.com/show_bug.cgi?id=1643338
9c6c51
9c6c51
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9c6c51
Reviewed-by: Erik Skultety <eskultet@redhat.com>
9c6c51
---
9c6c51
 src/qemu/qemu_process.c | 12 +++---------
9c6c51
 1 file changed, 3 insertions(+), 9 deletions(-)
9c6c51
9c6c51
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
9c6c51
index 23958bcbce..e4b19b938c 100644
9c6c51
--- a/src/qemu/qemu_process.c
9c6c51
+++ b/src/qemu/qemu_process.c
9c6c51
@@ -699,15 +699,10 @@ qemuProcessHandleResume(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
9c6c51
         priv->runningReason = VIR_DOMAIN_RUNNING_UNKNOWN;
9c6c51
     }
9c6c51
 
9c6c51
-    if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_PAUSED) {
9c6c51
-        if (priv->gotShutdown) {
9c6c51
-            VIR_DEBUG("Ignoring RESUME event after SHUTDOWN");
9c6c51
-            goto unlock;
9c6c51
-        }
9c6c51
-
9c6c51
+    if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_RUNNING) {
9c6c51
         eventDetail = qemuDomainRunningReasonToResumeEvent(reason);
9c6c51
-        VIR_DEBUG("Transitioned guest %s out of paused into resumed state, "
9c6c51
-                  "reason '%s', event detail %d",
9c6c51
+        VIR_DEBUG("Transitioned guest %s into running state, reason '%s', "
9c6c51
+                  "event detail %d",
9c6c51
                   vm->def->name, virDomainRunningReasonTypeToString(reason),
9c6c51
                   eventDetail);
9c6c51
 
9c6c51
@@ -722,7 +717,6 @@ qemuProcessHandleResume(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
9c6c51
         }
9c6c51
     }
9c6c51
 
9c6c51
- unlock:
9c6c51
     virObjectUnlock(vm);
9c6c51
     virObjectEventStateQueue(driver->domainEventState, event);
9c6c51
     virObjectUnref(cfg);
9c6c51
-- 
9c6c51
2.19.1
9c6c51