diff mbox series

[v10,05/10] migration: introduce postcopy-blocktime capability

Message ID 1505839684-10046-6-git-send-email-a.perevalov@samsung.com
State New
Headers show
Series calculate blocktime for postcopy live migration | expand

Commit Message

Alexey Perevalov Sept. 19, 2017, 4:47 p.m. UTC
Right now it could be used on destination side to
enable vCPU blocktime calculation for postcopy live migration.
vCPU blocktime - it's time since vCPU thread was put into
interruptible sleep, till memory page was copied and thread awake.

Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Alexey Perevalov <a.perevalov@samsung.com>
---
 migration/migration.c | 9 +++++++++
 migration/migration.h | 1 +
 qapi/migration.json   | 5 ++++-
 3 files changed, 14 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/migration/migration.c b/migration/migration.c
index e820d47..4f029e8 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1380,6 +1380,15 @@  bool migrate_zero_blocks(void)
     return s->enabled_capabilities[MIGRATION_CAPABILITY_ZERO_BLOCKS];
 }
 
+bool migrate_postcopy_blocktime(void)
+{
+    MigrationState *s;
+
+    s = migrate_get_current();
+
+    return s->enabled_capabilities[MIGRATION_CAPABILITY_POSTCOPY_BLOCKTIME];
+}
+
 bool migrate_use_compression(void)
 {
     MigrationState *s;
diff --git a/migration/migration.h b/migration/migration.h
index 148c9fa..56bf33c 100644
--- a/migration/migration.h
+++ b/migration/migration.h
@@ -184,6 +184,7 @@  int migrate_compress_level(void);
 int migrate_compress_threads(void);
 int migrate_decompress_threads(void);
 bool migrate_use_events(void);
+bool migrate_postcopy_blocktime(void);
 
 /* Sending on the return path - generic and then for each message type */
 void migrate_send_rp_shut(MigrationIncomingState *mis,
diff --git a/qapi/migration.json b/qapi/migration.json
index ee2b3b8..2e4a15d 100644
--- a/qapi/migration.json
+++ b/qapi/migration.json
@@ -341,12 +341,15 @@ 
 # @return-path: If enabled, migration will use the return path even
 #               for precopy. (since 2.10)
 #
+# @postcopy-blocktime: Calculate downtime for postcopy live migration
+#                     (since 2.11)
+#
 # Since: 1.2
 ##
 { 'enum': 'MigrationCapability',
   'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
            'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram',
-           'block', 'return-path' ] }
+           'block', 'return-path', 'postcopy-blocktime' ] }
 
 ##
 # @MigrationCapabilityStatus: