From patchwork Mon Jan 28 22:01:42 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: 216378 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 634562C009B for ; Tue, 29 Jan 2013 09:03:01 +1100 (EST) Received: from localhost ([::1]:54400 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tzwn5-0007wi-AX for incoming@patchwork.ozlabs.org; Mon, 28 Jan 2013 17:02:59 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34797) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tzwmp-0007pr-2e for qemu-devel@nongnu.org; Mon, 28 Jan 2013 17:02:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tzwmj-0007wF-Gu for qemu-devel@nongnu.org; Mon, 28 Jan 2013 17:02:42 -0500 Received: from e7.ny.us.ibm.com ([32.97.182.137]:35109) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tzwmj-0007vz-Aw for qemu-devel@nongnu.org; Mon, 28 Jan 2013 17:02:37 -0500 Received: from /spool/local by e7.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 28 Jan 2013 17:02:35 -0500 Received: from d01dlp02.pok.ibm.com (9.56.250.167) by e7.ny.us.ibm.com (192.168.1.107) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 28 Jan 2013 17:02:05 -0500 Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id C30DE6E8041 for ; Mon, 28 Jan 2013 17:02:03 -0500 (EST) Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r0SM24lR240236 for ; Mon, 28 Jan 2013 17:02:04 -0500 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r0SM24TC000382 for ; Mon, 28 Jan 2013 20:02:04 -0200 Received: from mrhinesdev.klabtestbed.com (klinux.watson.ibm.com [9.2.208.21]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r0SM1qhH030965; Mon, 28 Jan 2013 20:02:04 -0200 From: mrhines@linux.vnet.ibm.com To: qemu-devel@nongnu.org Date: Mon, 28 Jan 2013 17:01:42 -0500 Message-Id: <1359410505-4715-2-git-send-email-mrhines@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1359410505-4715-1-git-send-email-mrhines@linux.vnet.ibm.com> References: <1359410505-4715-1-git-send-email-mrhines@linux.vnet.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13012822-5806-0000-0000-00001EDD0D17 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 32.97.182.137 Cc: aliguori@us.ibm.com, abali@us.ibm.com, "Michael R. Hines" , gokul@us.ibm.com Subject: [Qemu-devel] [RFC PATCH RDMA support v1: 2/5] install new monitor commands to configure RDMA 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" Signed-off-by: Michael R. Hines --- hmp-commands.hx | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ hmp.c | 23 ++++++++++++++++++++++ hmp.h | 4 ++++ qapi-schema.json | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ qemu-options.hx | 10 ++++++++++ 5 files changed, 149 insertions(+) diff --git a/hmp-commands.hx b/hmp-commands.hx index 0934b9b..4cf8ece 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -895,6 +895,34 @@ Set cache size to @var{value} (in bytes) for xbzrle migrations. ETEXI { + .name = "migrate_rdma_prepare", + .args_type = "", + .params = "", + .help = "prepare for RDMA VM migration", + .mhandler.cmd = hmp_migrate_rdma_prepare, + }, + +STEXI +@item migrate_rdma_prepare +@findex migrate_rdma_prepare +Prepare the VM for RDMA VM migration. +ETEXI + + { + .name = "migrate_rdma_release", + .args_type = "", + .params = "", + .help = "release RDMA resources for VM migration", + .mhandler.cmd = hmp_migrate_rdma_release, + }, + +STEXI +@item migrate_rdma_release +@findex migrate_rdma_release +Release the RDMA resources used during VM RDMA migration. +ETEXI + + { .name = "migrate_set_speed", .args_type = "value:o", .params = "value", @@ -910,6 +938,34 @@ Set maximum speed to @var{value} (in bytes) for migrations. ETEXI { + .name = "migrate_set_rdma_port", + .args_type = "port:i", + .params = "port", + .help = "set RDMA port for migration", + .mhandler.cmd = hmp_migrate_set_rdma_port, + }, + +STEXI +@item migrate_set_rdma_port @var{value} +@findex migrate_set_rdma_port +Set RDMA migration port to @var{value}. +ETEXI + + { + .name = "migrate_set_rdma_host", + .args_type = "host:s", + .params = "host", + .help = "set RDMA host name for migration", + .mhandler.cmd = hmp_migrate_set_rdma_host, + }, + +STEXI +@item migrate_set_rdma_host @var{value} +@findex migrate_set_rdma_host +Set RDMA migration host name to @var{value}. +ETEXI + + { .name = "migrate_set_downtime", .args_type = "value:T", .params = "value", diff --git a/hmp.c b/hmp.c index c7b6ba0..4a2dd3b 100644 --- a/hmp.c +++ b/hmp.c @@ -848,6 +848,29 @@ void hmp_migrate_set_cache_size(Monitor *mon, const QDict *qdict) } } +void hmp_migrate_set_rdma_port(Monitor *mon, const QDict *qdict) +{ + int port = qdict_get_int(qdict, "port"); + qmp_migrate_set_rdma_port(port, NULL); +} + +void hmp_migrate_set_rdma_host(Monitor *mon, const QDict *qdict) +{ + const char *host = qdict_get_str(qdict, "host"); + qmp_migrate_set_rdma_host(host, NULL); +} + +void hmp_migrate_rdma_prepare(Monitor *mon, const QDict *qdict) +{ + qmp_migrate_rdma_prepare(NULL); +} + +void hmp_migrate_rdma_release(Monitor *mon, const QDict *qdict) +{ + qmp_migrate_rdma_release(NULL); +} + + void hmp_migrate_set_speed(Monitor *mon, const QDict *qdict) { int64_t value = qdict_get_int(qdict, "value"); diff --git a/hmp.h b/hmp.h index 44be683..185f343 100644 --- a/hmp.h +++ b/hmp.h @@ -55,6 +55,10 @@ 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_set_speed(Monitor *mon, const QDict *qdict); +void hmp_migrate_set_rdma_port(Monitor *mon, const QDict *qdict); +void hmp_migrate_set_rdma_host(Monitor *mon, const QDict *qdict); +void hmp_migrate_rdma_prepare(Monitor *mon, const QDict *qdict); +void hmp_migrate_rdma_release(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); void hmp_set_password(Monitor *mon, const QDict *qdict); diff --git a/qapi-schema.json b/qapi-schema.json index 6d7252b..181489b 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -1695,6 +1695,62 @@ { 'command': 'migrate_set_speed', 'data': {'value': 'int'} } ## +# @migrate_set_rdma_port +# +# Set rdma communication port. +# +# @port: rdma communication port. +# +# Returns: nothing on success +# +# Notes: Nothing. +# +# Since: 1.3.0 +## +{ 'command': 'migrate_set_rdma_port', 'data': {'port': 'int'} } + +## +# @migrate_set_rdma_host +# +# Set rdma communication host address. +# +# @host: rdma communication host address. +# +# Returns: nothing on success +# +# Notes: Nothing. +# +# Since: 1.3.0 +## +{ 'command': 'migrate_set_rdma_host', 'data': {'host': 'str'} } + +## +# @migrate_rdma_prepare +# +# Tell the backup QEMU to pre-register all of the RDMA memory +# +# Returns: nothing on success +# +# Notes: Nothing. +# +# Since: 1.3.0 +## +{ 'command': 'migrate_rdma_prepare' } + +## +# @migrate_rdma_release +# +# Tell the QEMU to release rdma resources +# +# Returns: nothing on success +# +# Notes: Nothing. +# +# Since: 1.3.0 +## +{ 'command': 'migrate_rdma_release' } + +## # @migrate-set-cache-size # # Set XBZRLE cache size diff --git a/qemu-options.hx b/qemu-options.hx index 4e2b499..dbd033b 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2796,6 +2796,16 @@ CD-ROM drive and others. The @code{-nodefaults} option will disable all those default devices. ETEXI +DEF("rdmaport", HAS_ARG, QEMU_OPTION_rdmaport, \ + "-rdmaport p port for RDMA migration\n", QEMU_ARCH_ALL) +STEXI +ETEXI + +DEF("rdmahost", HAS_ARG, QEMU_OPTION_rdmahost, \ + "-rdmahost p host name for RDMA migration\n", QEMU_ARCH_ALL) +STEXI +ETEXI + #ifndef _WIN32 DEF("chroot", HAS_ARG, QEMU_OPTION_chroot, \ "-chroot dir chroot to dir just before starting the VM\n",