]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Fix seamless SPICE migration
authorMartin Kletzander <mkletzan@redhat.com>
Fri, 20 Sep 2013 14:40:20 +0000 (16:40 +0200)
committerDoug Goldstein <cardoe@cardoe.com>
Wed, 25 Sep 2013 15:51:27 +0000 (10:51 -0500)
Since the wait is done during migration (still inside
QEMU_ASYNC_JOB_MIGRATION_OUT), the code should enter the monitor as such
in order to prohibit all other jobs from interfering in the meantime.
This patch fixes bug #1009886 in which qemuDomainGetBlockInfo was
waiting on the monitor condition and after GetSpiceMigrationStatus
mangled its internal data, the daemon crashed.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1009886
(cherry picked from commit 484cc3217b73b865f00bf42a9c12187b37200699)

src/qemu/qemu_migration.c

index b44c8d9b048645d45e9482a2d17562bfab1c6e89..609c64b6b2ed36e926e4c63262ae4ce468750aa9 100644 (file)
@@ -1615,7 +1615,10 @@ qemuMigrationWaitForSpice(virQEMUDriverPtr driver,
         /* Poll every 50ms for progress & to allow cancellation */
         struct timespec ts = { .tv_sec = 0, .tv_nsec = 50 * 1000 * 1000ull };
 
-        qemuDomainObjEnterMonitor(driver, vm);
+        if (qemuDomainObjEnterMonitorAsync(driver, vm,
+                                           QEMU_ASYNC_JOB_MIGRATION_OUT) < 0)
+            return -1;
+
         if (qemuMonitorGetSpiceMigrationStatus(priv->mon,
                                                &spice_migrated) < 0) {
             qemuDomainObjExitMonitor(driver, vm);