25aafc
From 1099f7c0e8741dd232d0f4568d2925cd791c6b69 Mon Sep 17 00:00:00 2001
25aafc
Message-Id: <1099f7c0e8741dd232d0f4568d2925cd791c6b69@dist-git>
25aafc
From: Jiri Denemark <jdenemar@redhat.com>
25aafc
Date: Thu, 16 Jan 2020 19:57:53 +0100
25aafc
Subject: [PATCH] qemu: Don't emit SUSPENDED_POSTCOPY event on destination
25aafc
MIME-Version: 1.0
25aafc
Content-Type: text/plain; charset=UTF-8
25aafc
Content-Transfer-Encoding: 8bit
25aafc
25aafc
When pause-before-switchover QEMU capability is enabled, we get STOP
25aafc
event before MIGRATION event with postcopy-active state. To properly
25aafc
handle post-copy migration and emit correct events commit
25aafc
v4.10.0-rc1-4-geca9d21e6c added a hack to
25aafc
qemuProcessHandleMigrationStatus which translates the paused state
25aafc
reason to VIR_DOMAIN_PAUSED_POSTCOPY and emits
25aafc
VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY event when migration state changes
25aafc
to post-copy.
25aafc
25aafc
However, the code was effective on both sides of migration resulting in
25aafc
a confusing VIR_DOMAIN_EVENT_SUSPENDED_POSTCOPY event on the destination
25aafc
host, where entering post-copy mode is already properly advertised by
25aafc
VIR_DOMAIN_EVENT_RESUMED_POSTCOPY event.
25aafc
25aafc
https://bugzilla.redhat.com/show_bug.cgi?id=1791458
25aafc
25aafc
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
25aafc
Reviewed-by: Ján Tomko <jtomko@redhat.com>
25aafc
(cherry picked from commit bd04d63ad97c21b6955710e6473a502f49816a3c)
25aafc
25aafc
https://bugzilla.redhat.com/show_bug.cgi?id=1791886
25aafc
25aafc
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
25aafc
Message-Id: <9b32d5af0dd1d3bf7108abc426dc4d6ceeaa84f8.1579193220.git.jdenemar@redhat.com>
25aafc
Reviewed-by: Ján Tomko <jtomko@redhat.com>
25aafc
---
25aafc
 src/qemu/qemu_process.c | 1 +
25aafc
 1 file changed, 1 insertion(+)
25aafc
25aafc
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
25aafc
index d813c59c0d..7a7fc8f205 100644
25aafc
--- a/src/qemu/qemu_process.c
25aafc
+++ b/src/qemu/qemu_process.c
25aafc
@@ -1546,6 +1546,7 @@ qemuProcessHandleMigrationStatus(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
25aafc
     virDomainObjBroadcast(vm);
25aafc
 
25aafc
     if (status == QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY &&
25aafc
+        priv->job.asyncJob == QEMU_ASYNC_JOB_MIGRATION_OUT &&
25aafc
         virDomainObjGetState(vm, &reason) == VIR_DOMAIN_PAUSED &&
25aafc
         reason == VIR_DOMAIN_PAUSED_MIGRATION) {
25aafc
         VIR_DEBUG("Correcting paused state reason for domain %s to %s",
25aafc
-- 
25aafc
2.25.0
25aafc