[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/19] migration: Create block capabilities for shar
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 09/19] migration: Create block capabilities for shared and enable |
Date: |
Mon, 17 Apr 2017 22:00:31 +0200 |
This two capabilites were added through the command line. Notice that
we just created them. This is just the boilerplate.
Signed-off-by: Juan Quintela <address@hidden>
---
include/migration/migration.h | 3 +++
migration/migration.c | 36 ++++++++++++++++++++++++++++++++++++
qapi-schema.json | 7 ++++++-
3 files changed, 45 insertions(+), 1 deletion(-)
diff --git a/include/migration/migration.h b/include/migration/migration.h
index d6f2e94..5c78ae1 100644
--- a/include/migration/migration.h
+++ b/include/migration/migration.h
@@ -242,6 +242,9 @@ bool migrate_colo_enabled(void);
int64_t xbzrle_cache_resize(int64_t new_size);
+bool migrate_use_block_enabled(void);
+bool migrate_use_block_shared(void);
+
bool migrate_use_compression(void);
int migrate_compress_level(void);
int migrate_compress_threads(void);
diff --git a/migration/migration.c b/migration/migration.c
index ce34be5..2f10657 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1151,6 +1151,16 @@ bool migration_is_blocked(Error **errp)
return false;
}
+static void migrate_set_block_shared(MigrationState *s)
+{
+ s->enabled_capabilities[MIGRATION_CAPABILITY_BLOCK_SHARED] = true;
+}
+
+static void migrate_set_block_enabled(MigrationState *s)
+{
+ s->enabled_capabilities[MIGRATION_CAPABILITY_BLOCK_ENABLED] = true;
+}
+
void qmp_migrate(const char *uri, bool has_blk, bool blk,
bool has_inc, bool inc, bool has_detach, bool detach,
Error **errp)
@@ -1180,6 +1190,14 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk,
s = migrate_init(¶ms);
+ if (has_blk && blk) {
+ migrate_set_block_enabled(s);
+ }
+
+ if (has_inc && inc) {
+ migrate_set_block_shared(s);
+ }
+
if (strstart(uri, "tcp:", &p)) {
tcp_start_outgoing_migration(s, p, &local_err);
#ifdef CONFIG_RDMA
@@ -1375,6 +1393,24 @@ int64_t migrate_xbzrle_cache_size(void)
return s->xbzrle_cache_size;
}
+bool migrate_use_block_enabled(void)
+{
+ MigrationState *s;
+
+ s = migrate_get_current();
+
+ return s->enabled_capabilities[MIGRATION_CAPABILITY_BLOCK_ENABLED];
+}
+
+bool migrate_use_block_shared(void)
+{
+ MigrationState *s;
+
+ s = migrate_get_current();
+
+ return s->enabled_capabilities[MIGRATION_CAPABILITY_BLOCK_SHARED];
+}
+
/* migration thread support */
/*
* Something bad happened to the RP stream, mark an error
diff --git a/qapi-schema.json b/qapi-schema.json
index 01b087f..e963bb3 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -894,11 +894,16 @@
# @release-ram: if enabled, qemu will free the migrated ram pages on the source
# during postcopy-ram migration. (since 2.9)
#
+# @block-enabled: enable block migration (Since 2.10)
+#
+# @block-shared: enable block shared migration (Since 2.10)
+#
# Since: 1.2
##
{ 'enum': 'MigrationCapability',
'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
- 'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram'] }
+ 'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram',
+ 'block-enabled', 'block-shared' ] }
##
# @MigrationCapabilityStatus:
--
2.9.3
- [Qemu-devel] [PATCH 01/19] migration: to_dst_file at that point is NULL, (continued)
- [Qemu-devel] [PATCH 01/19] migration: to_dst_file at that point is NULL, Juan Quintela, 2017/04/17
- [Qemu-devel] [PATCH 03/19] migration: Split migration/channel.c for channel operations, Juan Quintela, 2017/04/17
- [Qemu-devel] [PATCH 04/19] migration: Remove MigrationState from migration_channel_incomming(), Juan Quintela, 2017/04/17
- [Qemu-devel] [PATCH 05/19] migration: Export exec.c functions in its own file, Juan Quintela, 2017/04/17
- [Qemu-devel] [PATCH 06/19] migration: Export fd.c functions in its own file, Juan Quintela, 2017/04/17
- [Qemu-devel] [PATCH 07/19] migration: Export socket.c functions in its own file, Juan Quintela, 2017/04/17
- [Qemu-devel] [PATCH 08/19] migration: Export tls.c functions in its own file, Juan Quintela, 2017/04/17
- [Qemu-devel] [PATCH 09/19] migration: Create block capabilities for shared and enable,
Juan Quintela <=
- [Qemu-devel] [PATCH 10/19] migration: Remove use of old MigrationParams, Juan Quintela, 2017/04/17
- [Qemu-devel] [PATCH 13/19] migration: Remove qemu-file.h from vmstate.h, Juan Quintela, 2017/04/17
- [Qemu-devel] [PATCH 11/19] migration: Remove old MigrationParams, Juan Quintela, 2017/04/17
- [Qemu-devel] [PATCH 14/19] migration: Remove vmstate.h from migration.h, Juan Quintela, 2017/04/17