diff options
author | Dr. David Alan Gilbert <dgilbert@redhat.com> | 2017-10-20 10:05:55 +0100 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2017-10-23 18:03:32 +0200 |
commit | a7b36b486dd58d8f44f788a2a2efa6a4fa3b1223 (patch) | |
tree | 8d015d810d9ee5a363899391e8aad7d3c234c628 /migration | |
parent | 94ae12cba4f18253e3cf5f9a70335e22870053b4 (diff) |
migration: allow cancel to unpause
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>
Diffstat (limited to 'migration')
-rw-r--r-- | migration/migration.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/migration/migration.c b/migration/migration.c index 90bfdc3a7c..b523d8f215 100644 --- a/migration/migration.c +++ b/migration/migration.c @@ -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); |