]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Don't always wait for SPICE to finish migration
authorJiri Denemark <jdenemar@redhat.com>
Mon, 29 Feb 2016 12:18:13 +0000 (13:18 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Tue, 1 Mar 2016 14:59:00 +0000 (15:59 +0100)
When SPICE graphics is configured for a domain but we did not ask the
client to switch to the destination, we should not wait for
SPICE_MIGRATE_COMPLETED event (which will never come).

https://bugzilla.redhat.com/show_bug.cgi?id=1151723

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
src/qemu/qemu_domain.h
src/qemu/qemu_migration.c

index fe890a7f8660e740e4fc3f261c3a89e6c004a4ba..5cfec4c73fa2c71bff3d2096f525c6fa3094153a 100644 (file)
@@ -137,6 +137,8 @@ struct qemuDomainJobObj {
     qemuDomainJobInfoPtr current;       /* async job progress data */
     qemuDomainJobInfoPtr completed;     /* statistics data of a recently completed job */
     bool abortJob;                      /* abort of the job requested */
+    bool spiceMigration;                /* we asked for spice migration and we
+                                         * should wait for it to finish */
     bool spiceMigrated;                 /* spice migration completed */
 };
 
index 704e1828839283488816b8f335fd75e1822ad770..64cbffa59ae07c423660621c8528a39bd599ce5a 100644 (file)
@@ -2415,7 +2415,8 @@ qemuMigrationWaitForSpice(virDomainObjPtr vm)
     bool wait_for_spice = false;
     size_t i = 0;
 
-    if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_SEAMLESS_MIGRATION))
+    if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_SEAMLESS_MIGRATION) ||
+        !priv->job.spiceMigration)
         return 0;
 
     for (i = 0; i < vm->def->ngraphics; i++) {
@@ -2789,6 +2790,7 @@ qemuDomainMigrateGraphicsRelocate(virQEMUDriverPtr driver,
                                        QEMU_ASYNC_JOB_MIGRATION_OUT) == 0) {
         ret = qemuMonitorGraphicsRelocate(priv->mon, type, listenAddress,
                                           port, tlsPort, tlsSubject);
+        priv->job.spiceMigration = !ret;
         if (qemuDomainObjExitMonitor(driver, vm) < 0)
             ret = -1;
     }