From patchwork Wed Jan 25 11:26:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Orit Wasserman X-Patchwork-Id: 137840 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A82751007D2 for ; Thu, 26 Jan 2012 06:17:12 +1100 (EST) Received: from localhost ([::1]:36235 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rq7ZO-0000Uv-Rh for incoming@patchwork.ozlabs.org; Wed, 25 Jan 2012 13:27:42 -0500 Received: from eggs.gnu.org ([140.186.70.92]:42667) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rq12y-0003jU-EX for qemu-devel@nongnu.org; Wed, 25 Jan 2012 06:29:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rq12t-0000me-N5 for qemu-devel@nongnu.org; Wed, 25 Jan 2012 06:29:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54400) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rq12t-0000mT-GL for qemu-devel@nongnu.org; Wed, 25 Jan 2012 06:29:43 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q0PBTfPi029777 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 25 Jan 2012 06:29:41 -0500 Received: from dhcp-1-120.tlv.redhat.com (vpn-203-111.tlv.redhat.com [10.35.203.111]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q0PBSn62018677; Wed, 25 Jan 2012 06:29:38 -0500 From: Orit Wasserman To: qemu-devel@nongnu.org Date: Wed, 25 Jan 2012 13:26:46 +0200 Message-Id: <1327490809-21393-9-git-send-email-owasserm@redhat.com> In-Reply-To: <1327490809-21393-1-git-send-email-owasserm@redhat.com> References: <1327490809-21393-1-git-send-email-owasserm@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 X-Mailman-Approved-At: Wed, 25 Jan 2012 13:26:04 -0500 Cc: blauwirbel@gmail.com, stefanha@gmail.com, Orit Wasserman , avi@redhat.com, quintela@redhat.com Subject: [Qemu-devel] [PATCH v6 08/11] Add migration capabilties X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Add migration capabiltes that can be queried by the management. The managment can query to source and the destination in order to verfiy both support some maigration capability (currently only XBZRLE). Signed-off-by: Orit Wasserman --- hmp.c | 18 ++++++++++++++++++ hmp.h | 1 + migration.c | 12 ++++++++++++ monitor.c | 7 +++++++ qapi-schema.json | 24 ++++++++++++++++++++++++ qmp-commands.hx | 24 ++++++++++++++++++++++++ 6 files changed, 86 insertions(+), 0 deletions(-) diff --git a/hmp.c b/hmp.c index 4664dbe..9c41e50 100644 --- a/hmp.c +++ b/hmp.c @@ -155,6 +155,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 aab0b1f..fdb5b24 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 ce039e3..b2bb638 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 void migrate_fd_monitor_suspend(MigrationState *s, Monitor *mon) @@ -502,3 +513,4 @@ void qmp_migrate_set_downtime(double value, Error **errp) value = MAX(0, MIN(UINT64_MAX, value)); max_downtime = (uint64_t)value; } + diff --git a/monitor.c b/monitor.c index 187083c..5742765 100644 --- a/monitor.c +++ b/monitor.c @@ -2527,6 +2527,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 735eb35..060b7e6 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 799e655..e07d2c2 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -1955,6 +1955,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 -------------