Blame SOURCES/kvm-migration-Add-pause-before-switchover-capability.patch

9bac43
From 13a626395dc1a35e7a7ab0a501a83c5647e3267a Mon Sep 17 00:00:00 2001
9bac43
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
9bac43
Date: Wed, 25 Oct 2017 18:28:32 +0200
9bac43
Subject: [PATCH 13/19] migration: Add 'pause-before-switchover' capability
9bac43
9bac43
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
9bac43
Message-id: <20171025182838.31829-2-dgilbert@redhat.com>
9bac43
Patchwork-id: 77435
9bac43
O-Subject: [RHV-7.5 qemu-kvm-rhev PATCH 1/7] migration: Add 'pause-before-switchover' capability
9bac43
Bugzilla: 1497120
9bac43
RH-Acked-by: Peter Xu <peterx@redhat.com>
9bac43
RH-Acked-by: Juan Quintela <quintela@redhat.com>
9bac43
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
9bac43
9bac43
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
9bac43
9bac43
When 'pause-before-switchover' is enabled, the outgoing migration
9bac43
will pause before invalidating the block devices and serializing
9bac43
the device state.
9bac43
At this point the management layer gets the chance to clean up any
9bac43
device jobs or other device users before the migration completes.
9bac43
9bac43
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
9bac43
Reviewed-by: Peter Xu <peterx@redhat.com>
9bac43
Reviewed-by: Juan Quintela <quintela@redhat.com>
9bac43
Signed-off-by: Juan Quintela <quintela@redhat.com>
9bac43
(cherry picked from commit 93fbd0314ec060ffaf90169a06d5737fa97ffb25)
9bac43
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9bac43
9bac43
Conflicts:
9bac43
        migration/migration.c
9bac43
	migration/migration.h
9bac43
           Differences with other flags added
9bac43
	qapi/migration.json
9bac43
           Still in qapi-schema.json for us
9bac43
---
9bac43
 migration/migration.c | 10 ++++++++++
9bac43
 migration/migration.h |  1 +
9bac43
 qapi-schema.json      |  5 ++++-
9bac43
 3 files changed, 15 insertions(+), 1 deletion(-)
9bac43
9bac43
diff --git a/migration/migration.c b/migration/migration.c
9bac43
index c7b4d3d..d4356a4 100644
9bac43
--- a/migration/migration.c
9bac43
+++ b/migration/migration.c
9bac43
@@ -1426,6 +1426,16 @@ bool migrate_use_events(void)
9bac43
     return s->enabled_capabilities[MIGRATION_CAPABILITY_EVENTS];
9bac43
 }
9bac43
 
9bac43
+bool migrate_pause_before_switchover(void)
9bac43
+{
9bac43
+    MigrationState *s;
9bac43
+
9bac43
+    s = migrate_get_current();
9bac43
+
9bac43
+    return s->enabled_capabilities[
9bac43
+        MIGRATION_CAPABILITY_PAUSE_BEFORE_SWITCHOVER];
9bac43
+}
9bac43
+
9bac43
 int migrate_use_xbzrle(void)
9bac43
 {
9bac43
     MigrationState *s;
9bac43
diff --git a/migration/migration.h b/migration/migration.h
9bac43
index 8771ab0..2eebad8 100644
9bac43
--- a/migration/migration.h
9bac43
+++ b/migration/migration.h
9bac43
@@ -170,6 +170,7 @@ bool migrate_postcopy_ram(void);
9bac43
 bool migrate_zero_blocks(void);
9bac43
 
9bac43
 bool migrate_auto_converge(void);
9bac43
+bool migrate_pause_before_switchover(void);
9bac43
 
9bac43
 int migrate_use_xbzrle(void);
9bac43
 int64_t migrate_xbzrle_cache_size(void);
9bac43
diff --git a/qapi-schema.json b/qapi-schema.json
9bac43
index 0591d9d..9b9ec9a 100644
9bac43
--- a/qapi-schema.json
9bac43
+++ b/qapi-schema.json
9bac43
@@ -919,12 +919,15 @@
9bac43
 # @return-path: If enabled, migration will use the return path even
9bac43
 #               for precopy. (since 2.10)
9bac43
 #
9bac43
+# @pause-before-switchover: Pause outgoing migration before serialising device
9bac43
+#          state and before disabling block IO (since 2.11)
9bac43
+#
9bac43
 # Since: 1.2
9bac43
 ##
9bac43
 { 'enum': 'MigrationCapability',
9bac43
   'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
9bac43
            'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram',
9bac43
-           'block', 'return-path' ] }
9bac43
+           'block', 'return-path', 'pause-before-switchover' ] }
9bac43
 
9bac43
 ##
9bac43
 # @MigrationCapabilityStatus:
9bac43
-- 
9bac43
1.8.3.1
9bac43