3e5111
From 0ab58cdf99dbb5f71e91ebd047a984d48c9f9e6e Mon Sep 17 00:00:00 2001
3e5111
Message-Id: <0ab58cdf99dbb5f71e91ebd047a984d48c9f9e6e@dist-git>
3e5111
From: Jiri Denemark <jdenemar@redhat.com>
3e5111
Date: Wed, 5 Apr 2017 13:05:25 +0200
3e5111
Subject: [PATCH] qemu: Properly reset all migration capabilities
3e5111
3e5111
So far only QEMU_MONITOR_MIGRATION_CAPS_POSTCOPY was reset, but only in
3e5111
a single code path leaving post-copy enabled in quite a few cases.
3e5111
3e5111
https://bugzilla.redhat.com/show_bug.cgi?id=1425003
3e5111
3e5111
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3e5111
(cherry picked from commit 8be3ccd047e17c4998c669da2a63c3956e1f5225)
3e5111
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3e5111
---
3e5111
 src/qemu/qemu_migration.c | 10 +++++++---
3e5111
 1 file changed, 7 insertions(+), 3 deletions(-)
3e5111
3e5111
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
3e5111
index 3e9c35e4c..ae0ab368d 100644
3e5111
--- a/src/qemu/qemu_migration.c
3e5111
+++ b/src/qemu/qemu_migration.c
3e5111
@@ -5342,9 +5342,6 @@ qemuMigrationFinish(virQEMUDriverPtr driver,
3e5111
          */
3e5111
         if (inPostCopy)
3e5111
             VIR_FREE(priv->job.completed);
3e5111
-
3e5111
-        qemuMigrationSetPostCopy(driver, vm, false,
3e5111
-                                 QEMU_ASYNC_JOB_MIGRATION_IN);
3e5111
     }
3e5111
 
3e5111
     qemuMigrationReset(driver, vm, QEMU_ASYNC_JOB_MIGRATION_IN);
3e5111
@@ -5873,9 +5870,16 @@ qemuMigrationReset(virQEMUDriverPtr driver,
3e5111
                    virDomainObjPtr vm,
3e5111
                    qemuDomainAsyncJob job)
3e5111
 {
3e5111
+    qemuMonitorMigrationCaps cap;
3e5111
+
3e5111
     if (!virDomainObjIsActive(vm))
3e5111
         return;
3e5111
 
3e5111
     if (qemuMigrationResetTLS(driver, vm, job) < 0)
3e5111
         return;
3e5111
+
3e5111
+    for (cap = 0; cap < QEMU_MONITOR_MIGRATION_CAPS_LAST; cap++) {
3e5111
+        if (qemuMigrationSetOption(driver, vm, cap, false, job) < 0)
3e5111
+            return;
3e5111
+    }
3e5111
 }
3e5111
-- 
3e5111
2.12.2
3e5111