From patchwork Mon Feb 11 22:49:54 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: 219690 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 49B842C02C7 for ; Tue, 12 Feb 2013 09:51:10 +1100 (EST) Received: from localhost ([::1]:36878 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U52DM-0006Q0-Gc for incoming@patchwork.ozlabs.org; Mon, 11 Feb 2013 17:51:08 -0500 Received: from eggs.gnu.org ([208.118.235.92]:40314) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U52D2-0006Dm-20 for qemu-devel@nongnu.org; Mon, 11 Feb 2013 17:50:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U52Cx-0007oj-VN for qemu-devel@nongnu.org; Mon, 11 Feb 2013 17:50:47 -0500 Received: from e36.co.us.ibm.com ([32.97.110.154]:54570) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U52Cx-0007oY-M1 for qemu-devel@nongnu.org; Mon, 11 Feb 2013 17:50:43 -0500 Received: from /spool/local by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 11 Feb 2013 15:50:43 -0700 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 11 Feb 2013 15:50:41 -0700 Received: from d03relay01.boulder.ibm.com (d03relay01.boulder.ibm.com [9.17.195.226]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id A22F01FF003E for ; Mon, 11 Feb 2013 15:50:38 -0700 (MST) Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d03relay01.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r1BMoW1O476836 for ; Mon, 11 Feb 2013 15:50:33 -0700 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r1BMoWXM010180 for ; Mon, 11 Feb 2013 15:50:32 -0700 Received: from mrhinesdev.klabtestbed.com (klinux.watson.ibm.com [9.2.208.21]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r1BMoUWJ010052; Mon, 11 Feb 2013 15:50:32 -0700 From: "Michael R. Hines" To: qemu-devel@nongnu.org Date: Mon, 11 Feb 2013 17:49:54 -0500 Message-Id: <1360622997-26904-3-git-send-email-mrhines@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1360622997-26904-1-git-send-email-mrhines@linux.vnet.ibm.com> References: <1360622997-26904-1-git-send-email-mrhines@linux.vnet.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13021122-7606-0000-0000-00000844BED7 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 32.97.110.154 Cc: aliguori@us.ibm.com, abali@us.ibm.com, "Michael R. Hines" , gokul@us.ibm.com Subject: [Qemu-devel] [RFC PATCH RDMA support v2: 3/6] install new monitor commands and setup RDMA capabilities 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 | 28 ++++++++++++++++++++++++++++ hmp.c | 12 ++++++++++++ hmp.h | 2 ++ include/migration/qemu-file.h | 1 + include/qapi/qmp/qerror.h | 6 ++++++ qapi-schema.json | 34 ++++++++++++++++++++++++++++++++-- qemu-options.hx | 10 ++++++++++ 7 files changed, 91 insertions(+), 2 deletions(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index 0934b9b..4466c2e 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -910,6 +910,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..67c1d4a 100644 --- a/hmp.c +++ b/hmp.c @@ -848,6 +848,18 @@ 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_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..4ee5b92 100644 --- a/hmp.h +++ b/hmp.h @@ -55,6 +55,8 @@ 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_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/include/migration/qemu-file.h b/include/migration/qemu-file.h index 68deefb..7c9968e 100644 --- a/include/migration/qemu-file.h +++ b/include/migration/qemu-file.h @@ -112,6 +112,7 @@ int qemu_file_rate_limit(QEMUFile *f); int64_t qemu_file_set_rate_limit(QEMUFile *f, int64_t new_rate); int64_t qemu_file_get_rate_limit(QEMUFile *f); int qemu_file_get_error(QEMUFile *f); +void qemu_file_set_error(QEMUFile *f, int ret); static inline void qemu_put_be64s(QEMUFile *f, const uint64_t *pv) { diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h index 6c0a18d..6ae8b8c 100644 --- a/include/qapi/qmp/qerror.h +++ b/include/qapi/qmp/qerror.h @@ -165,6 +165,12 @@ void assert_no_error(Error *err); #define QERR_MIGRATION_ACTIVE \ ERROR_CLASS_GENERIC_ERROR, "There's a migration process in progress" +#define QERR_MIGRATION_RDMA_NOT_CONFIGURED \ + ERROR_CLASS_GENERIC_ERROR, "RMDA-based migration is missing port/hostname information %s:%d" + +#define QERR_MIGRATION_RDMA_NOT_ENABLED \ + ERROR_CLASS_GENERIC_ERROR, "RMDA-based migration has not been compiled/enabled." + #define QERR_MIGRATION_NOT_SUPPORTED \ ERROR_CLASS_GENERIC_ERROR, "State blocked by non-migratable device '%s'" diff --git a/qapi-schema.json b/qapi-schema.json index 6d7252b..5ce56f1 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -483,7 +483,7 @@ # Since: 1.2 ## { 'enum': 'MigrationCapability', - 'data': ['xbzrle'] } + 'data': ['xbzrle', 'rdma'] } ## # @MigrationCapabilityStatus @@ -502,7 +502,7 @@ ## # @migrate-set-capabilities # -# Enable/Disable the following migration capabilities (like xbzrle) +# Enable/Disable the following migration capabilities (like xbzrle or RDMA) # # @capabilities: json array of capability modifications to make # @@ -1695,6 +1695,36 @@ { '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-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",