[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 01/11] Add migration capabilities
From: |
Juan Quintela |
Subject: |
[Qemu-devel] [PATCH 01/11] Add migration capabilities |
Date: |
Wed, 1 Aug 2012 20:01:09 +0200 |
From: Orit Wasserman <address@hidden>
Add migration capabilities that can be queried by the management using
query-migration-supported-capabilities command.
The management can query the source QEMU and the destination QEMU in order to
verify both support some migration capability (currently only XBZRLE).
Signed-off-by: Orit Wasserman <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>
---
hmp-commands.hx | 2 ++
hmp.c | 21 +++++++++++++++++++++
hmp.h | 1 +
migration.c | 12 ++++++++++++
monitor.c | 7 +++++++
qapi-schema.json | 39 +++++++++++++++++++++++++++++++++++++++
qmp-commands.hx | 25 +++++++++++++++++++++++++
7 files changed, 107 insertions(+)
diff --git a/hmp-commands.hx b/hmp-commands.hx
index eea8b32..8267237 100644
--- a/hmp-commands.hx
+++ b/hmp-commands.hx
@@ -1417,6 +1417,8 @@ show CPU statistics
show user network stack connection states
@item info migrate
show migration status
address@hidden info migration_supported_capabilities
+show migration supported capabilities
@item info balloon
show balloon information
@item info qtree
diff --git a/hmp.c b/hmp.c
index 6b72a64..2ff71a3 100644
--- a/hmp.c
+++ b/hmp.c
@@ -161,6 +161,27 @@ void hmp_info_migrate(Monitor *mon)
qapi_free_MigrationInfo(info);
}
+void hmp_info_migration_supported_capabilities(Monitor *mon)
+{
+ MigrationCapabilityStatusList *caps_list, *cap;
+
+ caps_list = qmp_query_migration_supported_capabilities(NULL);
+ if (!caps_list) {
+ monitor_printf(mon, "No supported migration capabilities found\n");
+ return;
+ }
+
+ for (cap = caps_list; cap; cap = cap->next) {
+ monitor_printf(mon, "%s: %s ",
+ MigrationCapability_lookup[cap->value->capability],
+ cap->value->state ? "on" : "off");
+ }
+
+ monitor_printf(mon, "\n");
+
+ qapi_free_MigrationCapabilityStatusList(caps_list);
+}
+
void hmp_info_cpus(Monitor *mon)
{
CpuInfoList *cpu_list, *cpu;
diff --git a/hmp.h b/hmp.h
index 8d2b0d7..8442c22 100644
--- a/hmp.h
+++ b/hmp.h
@@ -25,6 +25,7 @@ void hmp_info_uuid(Monitor *mon);
void hmp_info_chardev(Monitor *mon);
void hmp_info_mice(Monitor *mon);
void hmp_info_migrate(Monitor *mon);
+void hmp_info_migration_supported_capabilities(Monitor *mon);
void hmp_info_cpus(Monitor *mon);
void hmp_info_block(Monitor *mon);
void hmp_info_blockstats(Monitor *mon);
diff --git a/migration.c b/migration.c
index 8db1b43..35444f7 100644
--- a/migration.c
+++ b/migration.c
@@ -166,6 +166,18 @@ MigrationInfo *qmp_query_migrate(Error **errp)
return info;
}
+MigrationCapabilityStatusList *
+qmp_query_migration_supported_capabilities(Error **errp)
+{
+ MigrationCapabilityStatusList *caps_list = g_malloc0(sizeof(*caps_list));
+
+ caps_list->value = g_malloc(sizeof(*caps_list->value));
+ caps_list->value->capability = MIGRATION_CAPABILITY_XBZRLE;
+ caps_list->next = NULL;
+
+ return caps_list;
+}
+
/* shared migration helpers */
static int migrate_fd_cleanup(MigrationState *s)
diff --git a/monitor.c b/monitor.c
index 49dccfe..bb55168 100644
--- a/monitor.c
+++ b/monitor.c
@@ -2655,6 +2655,13 @@ static mon_cmd_t info_cmds[] = {
.mhandler.info = hmp_info_migrate,
},
{
+ .name = "migration_supported_capabilities",
+ .args_type = "",
+ .params = "",
+ .help = "show migration supported capabilities",
+ .mhandler.info = hmp_info_migration_supported_capabilities,
+ },
+ {
.name = "balloon",
.args_type = "",
.params = "",
diff --git a/qapi-schema.json b/qapi-schema.json
index bc55ed2..9d4107b 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -306,6 +306,45 @@
{ 'command': 'query-migrate', 'returns': 'MigrationInfo' }
##
+# @MigrationCapability
+#
+# Migration capabilities enumeration
+#
+# @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
+# This feature allows us to minimize migration traffic for certain
work
+# loads, by sending compressed difference of the pages
+#
+# Since: 1.2
+##
+{ 'enum': 'MigrationCapability',
+ 'data': ['xbzrle'] }
+
+##
+# @MigrationCapabilityStatus
+#
+# Migration capability information
+#
+# @capability: capability enum
+#
+# @state: capability state bool
+#
+# Since: 1.2
+##
+{ 'type': 'MigrationCapabilityStatus',
+ 'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
+
+##
+# @query-migration-supported-capabilities
+#
+# Returns information about current migration process capabilities.
+#
+# Returns: @MigrationCapabilityStatus list
+#
+# Since: 1.2
+##
+{ 'command': 'query-migration-supported-capabilities', 'returns':
['MigrationCapabilityStatus'] }
+
+##
# @MouseInfo:
#
# Information about a mouse device.
diff --git a/qmp-commands.hx b/qmp-commands.hx
index e3cf3c5..16fbcef 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -2141,6 +2141,31 @@ EQMP
},
SQMP
+query-migration-supported-capabilities
+-------
+
+Query migration supported capabilities
+
+- "xbzrle": xbzrle support
+
+Arguments:
+
+Example:
+
+-> { "execute": "query-migration-supported-capabilities"}
+<- { "return": [ { "capability": "xbzrle", "state": true },
+ { "capability": "foobar", "state": false } ] }
+
+EQMP
+
+ {
+ .name = "query-migration-supported-capabilities",
+ .args_type = "",
+ .mhandler.cmd_new =
+ qmp_marshal_input_query_migration_supported_capabilities,
+ },
+
+SQMP
query-balloon
-------------
--
1.7.11.2
- [Qemu-devel] [PULL 00/11] Migration next, Juan Quintela, 2012/08/01
- [Qemu-devel] [PATCH 11/11] Restart optimization on stage3 update version, Juan Quintela, 2012/08/01
- [Qemu-devel] [PATCH 03/11] Add XBZRLE documentation, Juan Quintela, 2012/08/01
- [Qemu-devel] [PATCH 05/11] Add uleb encoding/decoding functions, Juan Quintela, 2012/08/01
- [Qemu-devel] [PATCH 01/11] Add migration capabilities,
Juan Quintela <=
- [Qemu-devel] [PATCH 02/11] Add migrate-set-capabilities and query-migrate-capabilities, Juan Quintela, 2012/08/01
- [Qemu-devel] [PATCH 08/11] Add migrate_set_cachesize command, Juan Quintela, 2012/08/01
- [Qemu-devel] [PATCH 10/11] Add XBZRLE statistics, Juan Quintela, 2012/08/01
- [Qemu-devel] [PATCH 09/11] Add migration accounting for normal and duplicate pages, Juan Quintela, 2012/08/01
- [Qemu-devel] [PATCH 06/11] Add xbzrle_encode_buffer and xbzrle_decode_buffer functions, Juan Quintela, 2012/08/01
- [Qemu-devel] [PATCH 04/11] Add cache handling functions, Juan Quintela, 2012/08/01
- [Qemu-devel] [PATCH 07/11] Add XBZRLE to ram_save_block and ram_save_live, Juan Quintela, 2012/08/01
- Re: [Qemu-devel] [PULL 00/11] Migration next, Anthony Liguori, 2012/08/02