]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Don't kill running migrated domain on daemon restart
authorJiri Denemark <jdenemar@redhat.com>
Fri, 8 Jan 2016 13:06:52 +0000 (14:06 +0100)
committerJiri Denemark <jdenemar@redhat.com>
Mon, 21 Mar 2016 14:15:46 +0000 (15:15 +0100)
When destination libvirtd is restarted during migration in Finish phase
just after the point we started guest CPUs, we should not kill the
domain.

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

index 52a30f2e3c9e0260b3dd250aaca5904cedb89139..ae47fe0c5cd01b2a5777f6a16a26a3a4d3347efd 100644 (file)
@@ -3173,9 +3173,13 @@ qemuProcessRecoverMigration(virQEMUDriverPtr driver,
 
         case QEMU_MIGRATION_PHASE_FINISH3:
             /* migration finished, we started resuming the domain but didn't
-             * confirm success or failure yet; killing it seems safest */
-            VIR_DEBUG("Killing migrated domain %s", vm->def->name);
-            return -1;
+             * confirm success or failure yet; killing it seems safest unless
+             * we already started guest CPUs */
+            if (state != VIR_DOMAIN_RUNNING) {
+                VIR_DEBUG("Killing migrated domain %s", vm->def->name);
+                return -1;
+            }
+            break;
         }
     } else if (job == QEMU_ASYNC_JOB_MIGRATION_OUT) {
         switch (phase) {