render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
43fe83
From a529b0f55b74654c07f9d0398e8fa179be76c3db Mon Sep 17 00:00:00 2001
43fe83
Message-Id: <a529b0f55b74654c07f9d0398e8fa179be76c3db.1380112456.git.jdenemar@redhat.com>
43fe83
From: Martin Kletzander <mkletzan@redhat.com>
43fe83
Date: Mon, 23 Sep 2013 10:40:21 +0200
43fe83
Subject: [PATCH] qemu: Fix seamless SPICE migration
43fe83
43fe83
https://bugzilla.redhat.com/show_bug.cgi?id=1010861
43fe83
43fe83
Since the wait is done during migration (still inside
43fe83
QEMU_ASYNC_JOB_MIGRATION_OUT), the code should enter the monitor as such
43fe83
in order to prohibit all other jobs from interfering in the meantime.
43fe83
This patch fixes bug #1009886 in which qemuDomainGetBlockInfo was
43fe83
waiting on the monitor condition and after GetSpiceMigrationStatus
43fe83
mangled its internal data, the daemon crashed.
43fe83
43fe83
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1009886
43fe83
(cherry picked from commit 484cc3217b73b865f00bf42a9c12187b37200699)
43fe83
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
43fe83
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
43fe83
---
43fe83
 src/qemu/qemu_migration.c | 5 ++++-
43fe83
 1 file changed, 4 insertions(+), 1 deletion(-)
43fe83
43fe83
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
43fe83
index 5fd52c1..4f53576 100644
43fe83
--- a/src/qemu/qemu_migration.c
43fe83
+++ b/src/qemu/qemu_migration.c
43fe83
@@ -1598,7 +1598,10 @@ qemuMigrationWaitForSpice(virQEMUDriverPtr driver,
43fe83
         /* Poll every 50ms for progress & to allow cancellation */
43fe83
         struct timespec ts = { .tv_sec = 0, .tv_nsec = 50 * 1000 * 1000ull };
43fe83
 
43fe83
-        qemuDomainObjEnterMonitor(driver, vm);
43fe83
+        if (qemuDomainObjEnterMonitorAsync(driver, vm,
43fe83
+                                           QEMU_ASYNC_JOB_MIGRATION_OUT) < 0)
43fe83
+            return -1;
43fe83
+
43fe83
         if (qemuMonitorGetSpiceMigrationStatus(priv->mon,
43fe83
                                                &spice_migrated) < 0) {
43fe83
             qemuDomainObjExitMonitor(driver, vm);
43fe83
-- 
43fe83
1.8.3.2
43fe83