]> git.proxmox.com Git - mirror_qemu.git/commitdiff
migration: set state to post-migrate on failure
authorDr. David Alan Gilbert <dgilbert@redhat.com>
Fri, 15 Jul 2016 16:44:46 +0000 (17:44 +0100)
committerAmit Shah <amit.shah@redhat.com>
Fri, 22 Jul 2016 07:53:09 +0000 (13:23 +0530)
If a migration fails/is cancelled during the postcopy stage we currently
end up with the runstate as finish-migrate, where it should be post-migrate.
There's a small window in precopy where I think the same thing can
happen, but I've never seen it.

It rarely matters; the only postcopy case is if you restart a migration, which
again is a case that rarely matters in postcopy because it's only
safe to restart the migration if you know the destination hasn't
been running (which you might if you started the destination with -S
and hadn't got around to 'c' ing it before the postcopy failed).
Even then it's a small window but potentially you could hit if
there's a problem loading the devices on the destination.

This corresponds to:
https://bugzilla.redhat.com/show_bug.cgi?id=1355683

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Amit Shah <amit.shah@redhat.com>
Message-Id: <1468601086-32117-1-git-send-email-dgilbert@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
migration/migration.c

index c4e019305ce6ed1176599bf321d8dd1d9b809388..955d5ee38cb1aaf11e61b69e2baa105c73cf06a5 100644 (file)
@@ -1837,6 +1837,10 @@ static void *migration_thread(void *opaque)
     } else {
         if (old_vm_running && !entered_postcopy) {
             vm_start();
+        } else {
+            if (runstate_check(RUN_STATE_FINISH_MIGRATE)) {
+                runstate_set(RUN_STATE_POSTMIGRATE);
+            }
         }
     }
     qemu_bh_schedule(s->cleanup_bh);