]> git.proxmox.com Git - mirror_qemu.git/commitdiff
migration: Recover block devices if failure in device state
authorDr. David Alan Gilbert <dgilbert@redhat.com>
Mon, 5 Feb 2018 09:13:37 +0000 (09:13 +0000)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Mon, 12 Feb 2018 03:05:39 +0000 (21:05 -0600)
In e91d895 I added the new pause-before-switchover mechanism
to allow migration completion to be delayed; this changes the
last state prior to completion to MIGRATE_STATUS_DEVICE rather
than MIGRATE_STATUS_ACTIVE.

Fix the failure path in migration_completion to recover the block
devices if it fails in MIGRATE_STATUS_DEVICE, not just the
MIGRATE_STATUS_ACTIVE that it previously had.

This corresponds to rh bz:
  https://bugzilla.redhat.com/show_bug.cgi?id=1538494
whose symptom is an occasional source crash on a failed migration.

Fixes: e91d8951d59d483f085f
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
(cherry picked from commit 6039dd5b1c45d76403b9dcadd2afd7efd8f42330)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
migration/migration.c

index 4de3b551fe419deb0cabc49d824dcfd98dc7dc54..d780601f0c4d396973267d676b592ff9dd9525e6 100644 (file)
@@ -2128,7 +2128,8 @@ fail_invalidate:
     /* If not doing postcopy, vm_start() will be called: let's regain
      * control on images.
      */
-    if (s->state == MIGRATION_STATUS_ACTIVE) {
+    if (s->state == MIGRATION_STATUS_ACTIVE ||
+        s->state == MIGRATION_STATUS_DEVICE) {
         Error *local_err = NULL;
 
         qemu_mutex_lock_iothread();