From: Juan Quintela <quintela@redhat.com>
To: qemu-devel@nongnu.org
Cc: dgilbert@redhat.com, lvivier@redhat.com, peterx@redhat.com
Subject: [Qemu-devel] [PATCH 1/3] migration: Create block capabilities for shared and enable
Date: Tue, 25 Apr 2017 12:30:47 +0200 [thread overview]
Message-ID: <20170425103049.4073-2-quintela@redhat.com> (raw)
In-Reply-To: <20170425103049.4073-1-quintela@redhat.com>
Those two capabilities were added through the command line. Notice that
we just created them. This is just the boilerplate.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
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 dfeca38..618ab0e 100644
--- a/include/migration/migration.h
+++ b/include/migration/migration.h
@@ -307,6 +307,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 5447cab..775b24c 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1195,6 +1195,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)
@@ -1224,6 +1234,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
@@ -1419,6 +1437,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
next prev parent reply other threads:[~2017-04-25 10:30 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-25 10:30 [Qemu-devel] [PATCH 0/3] Remove old MigrationParams Juan Quintela
2017-04-25 10:30 ` Juan Quintela [this message]
2017-04-25 10:30 ` [Qemu-devel] [PATCH 2/3] migration: Remove use of " Juan Quintela
2017-04-28 16:55 ` Dr. David Alan Gilbert
2017-05-04 8:51 ` Juan Quintela
2017-05-04 9:14 ` Hailiang Zhang
2017-05-11 16:33 ` Juan Quintela
2017-05-12 2:02 ` Hailiang Zhang
2017-04-28 18:49 ` Eric Blake
2017-04-25 10:30 ` [Qemu-devel] [PATCH 3/3] migration: Remove " Juan Quintela
2017-04-28 16:57 ` Dr. David Alan Gilbert
-- strict thread matches above, loose matches on Subject: below --
2017-05-11 16:32 [Qemu-devel] [PATCH v2 0/3] " Juan Quintela
2017-05-11 16:32 ` [Qemu-devel] [PATCH 1/3] migration: Create block capabilities for shared and enable Juan Quintela
2017-05-12 19:52 ` Eric Blake
2017-05-15 9:41 ` Juan Quintela
2017-05-15 9:46 ` Dr. David Alan Gilbert
2017-05-15 14:24 ` Eric Blake
2017-05-15 15:38 ` Markus Armbruster
2017-05-15 16:06 ` Juan Quintela
2017-05-16 6:49 ` Markus Armbruster
2017-05-15 15:56 ` Juan Quintela
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170425103049.4073-2-quintela@redhat.com \
--to=quintela@redhat.com \
--cc=dgilbert@redhat.com \
--cc=lvivier@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).