]> git.proxmox.com Git - mirror_qemu.git/commitdiff
migration: allow cancel to unpause
authorDr. David Alan Gilbert <dgilbert@redhat.com>
Fri, 20 Oct 2017 09:05:55 +0000 (10:05 +0100)
committerJuan Quintela <quintela@redhat.com>
Mon, 23 Oct 2017 16:03:32 +0000 (18:03 +0200)
If a migration_cancel is issued during the new paused state,
kick the pause_sem to get to unpause so it can cancel.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
migration/migration.c

index 90bfdc3a7c2c17471da425747f860fd94a7e2be1..b523d8f2155aaed2a50f842f387c88cdc77c42ec 100644 (file)
@@ -1114,6 +1114,10 @@ static void migrate_fd_cancel(MigrationState *s)
         if (!migration_is_setup_or_active(old_state)) {
             break;
         }
+        /* If the migration is paused, kick it out of the pause */
+        if (old_state == MIGRATION_STATUS_PRE_SWITCHOVER) {
+            qemu_sem_post(&s->pause_sem);
+        }
         migrate_set_state(&s->state, old_state, MIGRATION_STATUS_CANCELLING);
     } while (s->state != MIGRATION_STATUS_CANCELLING);