From patchwork Wed Apr 10 22:28:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: mrhines@linux.vnet.ibm.com X-Patchwork-Id: 235507 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B04402C00B2 for ; Thu, 11 Apr 2013 08:32:37 +1000 (EST) Received: from localhost ([::1]:58959 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQ3ZD-0005bi-Rk for incoming@patchwork.ozlabs.org; Wed, 10 Apr 2013 18:32:35 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57123) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQ3VR-00080B-V2 for qemu-devel@nongnu.org; Wed, 10 Apr 2013 18:28:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQ3VL-0001BE-2t for qemu-devel@nongnu.org; Wed, 10 Apr 2013 18:28:41 -0400 Received: from e38.co.us.ibm.com ([32.97.110.159]:49335) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQ3VK-0001Ao-SF for qemu-devel@nongnu.org; Wed, 10 Apr 2013 18:28:34 -0400 Received: from /spool/local by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 10 Apr 2013 16:28:34 -0600 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e38.co.us.ibm.com (192.168.1.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 10 Apr 2013 16:28:32 -0600 Received: from d03relay01.boulder.ibm.com (d03relay01.boulder.ibm.com [9.17.195.226]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id 864F11FF003F for ; Wed, 10 Apr 2013 16:23:31 -0600 (MDT) Received: from d03av06.boulder.ibm.com (d03av06.boulder.ibm.com [9.17.195.245]) by d03relay01.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r3AMSVuN113318 for ; Wed, 10 Apr 2013 16:28:31 -0600 Received: from d03av06.boulder.ibm.com (loopback [127.0.0.1]) by d03av06.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r3AMVIJZ003488 for ; Wed, 10 Apr 2013 16:31:18 -0600 Received: from mrhinesdev.klabtestbed.com (klinux.watson.ibm.com [9.2.208.21]) by d03av06.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r3AMV9kr002979; Wed, 10 Apr 2013 16:31:17 -0600 From: mrhines@linux.vnet.ibm.com To: qemu-devel@nongnu.org Date: Wed, 10 Apr 2013 18:28:18 -0400 Message-Id: <1365632901-15470-11-git-send-email-mrhines@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1365632901-15470-1-git-send-email-mrhines@linux.vnet.ibm.com> References: <1365632901-15470-1-git-send-email-mrhines@linux.vnet.ibm.com> X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13041022-5518-0000-0000-00000D6A44CD X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 32.97.110.159 Cc: aliguori@us.ibm.com, mst@redhat.com, owasserm@redhat.com, abali@us.ibm.com, mrhines@us.ibm.com, gokul@us.ibm.com, pbonzini@redhat.com Subject: [Qemu-devel] [RFC PATCH RDMA support v1: 10/13] introduce new command migrate_check_for_zero 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 From: "Michael R. Hines" This allows the user to disable zero page checking during migration Signed-off-by: Michael R. Hines --- hmp-commands.hx | 14 ++++++++++++++ hmp.c | 6 ++++++ hmp.h | 1 + migration.c | 12 ++++++++++++ qapi-schema.json | 13 +++++++++++++ qmp-commands.hx | 23 +++++++++++++++++++++++ 6 files changed, 69 insertions(+) diff --git a/hmp-commands.hx b/hmp-commands.hx index 3d98604..b593095 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -962,6 +962,20 @@ Set maximum tolerated downtime (in seconds) for migration. ETEXI { + .name = "migrate_check_for_zero", + .args_type = "value:b", + .params = "value", + .help = "Control whether or not to check for zero pages", + .mhandler.cmd = hmp_migrate_check_for_zero, + }, + +STEXI +@item migrate_check_for_zero @var{value} +@findex migrate_check_for_zero +Control whether or not to check for zero pages. +ETEXI + + { .name = "migrate_set_capability", .args_type = "capability:s,state:b", .params = "capability state", diff --git a/hmp.c b/hmp.c index dbe9b90..68ba93a 100644 --- a/hmp.c +++ b/hmp.c @@ -909,6 +909,12 @@ void hmp_migrate_set_downtime(Monitor *mon, const QDict *qdict) qmp_migrate_set_downtime(value, NULL); } +void hmp_migrate_check_for_zero(Monitor *mon, const QDict *qdict) +{ + bool value = qdict_get_bool(qdict, "value"); + qmp_migrate_check_for_zero(value, NULL); +} + void hmp_migrate_set_cache_size(Monitor *mon, const QDict *qdict) { int64_t value = qdict_get_int(qdict, "value"); diff --git a/hmp.h b/hmp.h index 80e8b41..a6595da 100644 --- a/hmp.h +++ b/hmp.h @@ -58,6 +58,7 @@ void hmp_snapshot_blkdev(Monitor *mon, const QDict *qdict); void hmp_drive_mirror(Monitor *mon, const QDict *qdict); void hmp_migrate_cancel(Monitor *mon, const QDict *qdict); void hmp_migrate_set_downtime(Monitor *mon, const QDict *qdict); +void hmp_migrate_check_for_zero(Monitor *mon, const QDict *qdict); void hmp_migrate_set_speed(Monitor *mon, const QDict *qdict); void hmp_migrate_set_capability(Monitor *mon, const QDict *qdict); void hmp_migrate_set_cache_size(Monitor *mon, const QDict *qdict); diff --git a/migration.c b/migration.c index a2fcacf..9072479 100644 --- a/migration.c +++ b/migration.c @@ -485,6 +485,18 @@ void qmp_migrate_set_downtime(double value, Error **errp) max_downtime = (uint64_t)value; } +static bool check_for_zero = true; + +void qmp_migrate_check_for_zero(bool value, Error **errp) +{ + check_for_zero = value; +} + +bool migrate_check_for_zero(void) +{ + return check_for_zero; +} + bool migrate_chunk_register_destination(void) { MigrationState *s; diff --git a/qapi-schema.json b/qapi-schema.json index 7fe7e5c..1ca939f 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -1792,6 +1792,19 @@ { 'command': 'migrate_set_downtime', 'data': {'value': 'number'} } ## +# @migrate_check_for_zero +# +# Control whether or not to check for zero pages during migration. +# +# @value: on|off +# +# Returns: nothing on success +# +# Since: 1.5.0 +## +{ 'command': 'migrate_check_for_zero', 'data': {'value': 'bool'} } + +## # @migrate_set_speed # # Set maximum speed for migration. diff --git a/qmp-commands.hx b/qmp-commands.hx index 1e0e11e..78cda67 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -750,6 +750,29 @@ Example: EQMP { + .name = "migrate_check_for_zero", + .args_type = "value:b", + .mhandler.cmd_new = qmp_marshal_input_migrate_check_for_zero, + }, + +SQMP +migrate_check_for_zero +---------------------- + +Control whether or not to check for zero pages. + +Arguments: + +- "value": true or false (json-bool) + +Example: + +-> { "execute": "migrate_check_for_zero", "arguments": { "value": true } } +<- { "return": {} } + +EQMP + + { .name = "client_migrate_info", .args_type = "protocol:s,hostname:s,port:i?,tls-port:i?,cert-subject:s?", .params = "protocol hostname port tls-port cert-subject",