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

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