Blame SOURCES/kvm-migration-allow-cancel-to-unpause.patch

4a2fec
From a25e94a891b4633f6039e39f5c63041f4a0b6722 Mon Sep 17 00:00:00 2001
4a2fec
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
4a2fec
Date: Wed, 25 Oct 2017 18:28:37 +0200
4a2fec
Subject: [PATCH 18/19] migration: allow cancel to unpause
4a2fec
4a2fec
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
4a2fec
Message-id: <20171025182838.31829-7-dgilbert@redhat.com>
4a2fec
Patchwork-id: 77438
4a2fec
O-Subject: [RHV-7.5 qemu-kvm-rhev PATCH 6/7] migration: allow cancel to unpause
4a2fec
Bugzilla: 1497120
4a2fec
RH-Acked-by: Peter Xu <peterx@redhat.com>
4a2fec
RH-Acked-by: Juan Quintela <quintela@redhat.com>
4a2fec
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
4a2fec
4a2fec
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
4a2fec
4a2fec
If a migration_cancel is issued during the new paused state,
4a2fec
kick the pause_sem to get to unpause so it can cancel.
4a2fec
4a2fec
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
4a2fec
Reviewed-by: Peter Xu <peterx@redhat.com>
4a2fec
Reviewed-by: Juan Quintela <quintela@redhat.com>
4a2fec
Signed-off-by: Juan Quintela <quintela@redhat.com>
4a2fec
(cherry picked from commit a7b36b486dd58d8f44f788a2a2efa6a4fa3b1223)
4a2fec
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
4a2fec
---
4a2fec
 migration/migration.c | 4 ++++
4a2fec
 1 file changed, 4 insertions(+)
4a2fec
4a2fec
diff --git a/migration/migration.c b/migration/migration.c
4a2fec
index 3a1dabb..3f23ed0 100644
4a2fec
--- a/migration/migration.c
4a2fec
+++ b/migration/migration.c
4a2fec
@@ -1027,6 +1027,10 @@ static void migrate_fd_cancel(MigrationState *s)
4a2fec
         if (!migration_is_setup_or_active(old_state)) {
4a2fec
             break;
4a2fec
         }
4a2fec
+        /* If the migration is paused, kick it out of the pause */
4a2fec
+        if (old_state == MIGRATION_STATUS_PRE_SWITCHOVER) {
4a2fec
+            qemu_sem_post(&s->pause_sem);
4a2fec
+        }
4a2fec
         migrate_set_state(&s->state, old_state, MIGRATION_STATUS_CANCELLING);
4a2fec
     } while (s->state != MIGRATION_STATUS_CANCELLING);
4a2fec
 
4a2fec
-- 
4a2fec
1.8.3.1
4a2fec