qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Orit Wasserman <owasserm@redhat.com>
To: qemu-devel@nongnu.org
Cc: aliguori@us.ibm.com, quintela@redhat.com, stefanha@gmail.com,
	blauwirbel@gmail.com, Orit Wasserman <owasserm@redhat.com>,
	avi@redhat.com
Subject: [Qemu-devel] [PATCH v8 08/10] Add migration capabilites
Date: Thu,  5 Apr 2012 13:47:57 +0300	[thread overview]
Message-ID: <1333622879-12055-9-git-send-email-owasserm@redhat.com> (raw)
In-Reply-To: <1333622879-12055-1-git-send-email-owasserm@redhat.com>

Add migration capabiltes that can be queried by the management.
The managment can query to source and the destination in order to
verify both support some maigration capability (currently only XBZRLE).

Signed-off-by: Orit Wasserman <owasserm@redhat.com>
---
 hmp.c            |   18 ++++++++++++++++++
 hmp.h            |    1 +
 migration.c      |   11 +++++++++++
 monitor.c        |    7 +++++++
 qapi-schema.json |   24 ++++++++++++++++++++++++
 qmp-commands.hx  |   24 ++++++++++++++++++++++++
 savevm.c         |    2 +-
 7 files changed, 86 insertions(+), 1 deletions(-)

diff --git a/hmp.c b/hmp.c
index c2f8c31..186a119 100644
--- a/hmp.c
+++ b/hmp.c
@@ -156,6 +156,24 @@ void hmp_info_migrate(Monitor *mon)
     qapi_free_MigrationInfo(info);
 }
 
+void hmp_info_migration_caps(Monitor *mon)
+{
+    MigrationCapList *caps_list, *cap;
+
+    caps_list = qmp_query_migration_caps(NULL);
+    if (!caps_list) {
+        monitor_printf(mon, "No migration capabilities found\n");
+        return;
+    }
+
+    for (cap = caps_list; cap; cap = cap->next) {
+        monitor_printf(mon, "%s\n", cap->value->name);
+    }
+
+    qapi_free_MigrationCapList(caps_list);
+
+}
+
 void hmp_info_cpus(Monitor *mon)
 {
     CpuInfoList *cpu_list, *cpu;
diff --git a/hmp.h b/hmp.h
index 8807853..1c53d35 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_caps(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 66238de..db8c3d8 100644
--- a/migration.c
+++ b/migration.c
@@ -161,6 +161,17 @@ MigrationInfo *qmp_query_migrate(Error **errp)
     return info;
 }
 
+MigrationCapList *qmp_query_migration_caps(Error **errp)
+{
+    MigrationCapList *caps_list = g_malloc0(sizeof(*caps_list));
+
+    caps_list->value = g_malloc(sizeof(*caps_list->value));
+    caps_list->value->name = g_strdup("uleb");
+    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 8946a10..ff434e0 100644
--- a/monitor.c
+++ b/monitor.c
@@ -2558,6 +2558,13 @@ static mon_cmd_t info_cmds[] = {
         .mhandler.info = hmp_info_migrate,
     },
     {
+        .name       = "migration_caps",
+        .args_type  = "",
+        .params     = "",
+        .help       = "show migration capabilties",
+        .mhandler.info = hmp_info_migration_caps,
+    },
+    {
         .name       = "balloon",
         .args_type  = "",
         .params     = "",
diff --git a/qapi-schema.json b/qapi-schema.json
index 8b1c78a..e49ec43 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -276,6 +276,30 @@
 { 'command': 'query-migrate', 'returns': 'MigrationInfo' }
 
 ##
+# @MigrationCap
+#
+# Information about current migration capabilites.
+#
+# @xbzrle: true if the current migration supports xbzrle
+#
+# Since: 1.1
+##
+{ 'type': 'MigrationCap',
+  'data': { 'name': 'str'} }
+
+##
+# @query-migration-caps
+#
+# Returns information about current migration process capabilties.
+#
+# Returns: @MigrationCap
+#
+# Since: 1.1
+##
+{ 'command': 'query-migration-caps', 'returns': ['MigrationCap'] }
+
+
+##
 # @MouseInfo:
 #
 # Information about a mouse device.
diff --git a/qmp-commands.hx b/qmp-commands.hx
index 5d3714f..c21ec1c 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -2073,6 +2073,30 @@ EQMP
     },
 
 SQMP
+query-migration-caps
+-------
+
+Query migration capabilties
+
+- "xbzrle": xbzrle support
+
+Arguments:
+
+Example:
+
+-> { "execute": "query-migration-caps"}
+<- { "return": { "xbzrle" : true } }
+
+EQMP
+
+    {
+        .name       = "query_migration_caps",
+        .args_type  = "",
+	.mhandler.cmd_new = qmp_marshal_input_query_migration_caps,
+    },
+
+
+SQMP
 query-balloon
 -------------
 
diff --git a/savevm.c b/savevm.c
index fbf1903..3c0b7cc 100644
--- a/savevm.c
+++ b/savevm.c
@@ -1573,7 +1573,7 @@ int qemu_savevm_state_begin(QEMUFile *f,
 	}
         se->set_params(params, se->opaque);
     }
-    
+
     qemu_put_be32(f, QEMU_VM_FILE_MAGIC);
     qemu_put_be32(f, QEMU_VM_FILE_VERSION);
 
-- 
1.7.7.6

  parent reply	other threads:[~2012-04-05 10:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-05 10:47 [Qemu-devel] [PATCH v8 00/10] XBZRLE delta for live migration of large memory app Orit Wasserman
2012-04-05 10:47 ` [Qemu-devel] [PATCH v8 01/10] Add cache handling functions Orit Wasserman
2012-04-05 10:47 ` [Qemu-devel] [PATCH v8 02/10] Add uleb encoding/decoding functions Orit Wasserman
2012-04-05 10:47 ` [Qemu-devel] [PATCH v8 03/10] Add save_block_hdr function Orit Wasserman
2012-04-05 10:47 ` [Qemu-devel] [PATCH v8 04/10] Add host_from_stream_offset_versioned function Orit Wasserman
2012-04-05 10:47 ` [Qemu-devel] [PATCH v8 05/10] Add MigrationParams structure Orit Wasserman
2012-04-05 10:47 ` [Qemu-devel] [PATCH v8 06/10] Add XBZRLE to ram_save_block and ram_save_live Orit Wasserman
2012-04-05 10:47 ` [Qemu-devel] [PATCH v8 07/10] Add XBZRLE option to migrate command Orit Wasserman
2012-04-05 10:47 ` Orit Wasserman [this message]
2012-04-05 10:47 ` [Qemu-devel] [PATCH v8 09/10] Add set_cachesize command Orit Wasserman
2012-04-05 12:15   ` Avi Kivity
2012-04-05 12:17     ` Avi Kivity
2012-04-05 10:47 ` [Qemu-devel] [PATCH v8 10/10] Add XBZRLE statstics information Orit Wasserman

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=1333622879-12055-9-git-send-email-owasserm@redhat.com \
    --to=owasserm@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=stefanha@gmail.com \
    /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).