From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPOsC-0000IZ-8I for qemu-devel@nongnu.org; Mon, 08 Apr 2013 23:05:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPOs6-0004l4-E2 for qemu-devel@nongnu.org; Mon, 08 Apr 2013 23:05:28 -0400 Received: from e39.co.us.ibm.com ([32.97.110.160]:55938) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPOs6-0004kw-81 for qemu-devel@nongnu.org; Mon, 08 Apr 2013 23:05:22 -0400 Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 8 Apr 2013 21:05:21 -0600 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 0F8DA19D8042 for ; Mon, 8 Apr 2013 21:05:15 -0600 (MDT) Received: from d03av06.boulder.ibm.com (d03av06.boulder.ibm.com [9.17.195.245]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r3935Jo0269204 for ; Mon, 8 Apr 2013 21:05:19 -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 r39385G3013340 for ; Mon, 8 Apr 2013 21:08:05 -0600 From: mrhines@linux.vnet.ibm.com Date: Mon, 8 Apr 2013 23:04:37 -0400 Message-Id: <1365476681-31593-9-git-send-email-mrhines@linux.vnet.ibm.com> In-Reply-To: <1365476681-31593-1-git-send-email-mrhines@linux.vnet.ibm.com> References: <1365476681-31593-1-git-send-email-mrhines@linux.vnet.ibm.com> Subject: [Qemu-devel] [RFC PATCH RDMA support v5: 08/12] new capabilities added and check for QMP string 'rdma' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 From: "Michael R. Hines" 1. capability for zero pages (enabled by default) 2. capability for dynamic server chunk registration (disabled by default) Signed-off-by: Michael R. Hines --- migration.c | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/migration.c b/migration.c index 3b4b467..f01efa9 100644 --- a/migration.c +++ b/migration.c @@ -15,6 +15,7 @@ #include "qemu-common.h" #include "migration/migration.h" +#include "migration/rdma.h" #include "monitor/monitor.h" #include "migration/qemu-file.h" #include "sysemu/sysemu.h" @@ -68,6 +69,18 @@ MigrationState *migrate_get_current(void) .xbzrle_cache_size = DEFAULT_MIGRATE_CACHE_SIZE, }; + static bool first_time = 1; + + /* + * Historically, checking for zeros is enabled + * by default. Require the user to disable it + * (for example RDMA), if they really want to. + */ + if(first_time) { + current_migration.enabled_capabilities[MIGRATION_CAPABILITY_CHECK_FOR_ZERO] = true; + first_time = 0; + } + return ¤t_migration; } @@ -77,6 +90,8 @@ void qemu_start_incoming_migration(const char *uri, Error **errp) if (strstart(uri, "tcp:", &p)) tcp_start_incoming_migration(p, errp); + else if (strstart(uri, "rdma:", &p)) + rdma_start_incoming_migration(p, errp); #if !defined(WIN32) else if (strstart(uri, "exec:", &p)) exec_start_incoming_migration(p, errp); @@ -120,7 +135,6 @@ void process_incoming_migration(QEMUFile *f) Coroutine *co = qemu_coroutine_create(process_incoming_migration_co); int fd = qemu_get_fd(f); - assert(fd != -1); qemu_set_nonblock(fd); qemu_coroutine_enter(co, f); } @@ -405,6 +419,8 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, if (strstart(uri, "tcp:", &p)) { tcp_start_outgoing_migration(s, p, &local_err); + } else if (strstart(uri, "rdma:", &p)) { + rdma_start_outgoing_migration(s, p, &local_err); #if !defined(WIN32) } else if (strstart(uri, "exec:", &p)) { exec_start_outgoing_migration(s, p, &local_err); @@ -474,6 +490,24 @@ void qmp_migrate_set_downtime(double value, Error **errp) max_downtime = (uint64_t)value; } +bool migrate_chunk_register_destination(void) +{ + MigrationState *s; + + s = migrate_get_current(); + + return s->enabled_capabilities[MIGRATION_CAPABILITY_CHUNK_REGISTER_DESTINATION]; +} + +bool migrate_check_for_zero(void) +{ + MigrationState *s; + + s = migrate_get_current(); + + return s->enabled_capabilities[MIGRATION_CAPABILITY_CHECK_FOR_ZERO]; +} + int migrate_use_xbzrle(void) { MigrationState *s; @@ -546,8 +580,9 @@ static void *migration_thread(void *opaque) max_size = bandwidth * migrate_max_downtime() / 1000000; DPRINTF("transferred %" PRIu64 " time_spent %" PRIu64 - " bandwidth %g max_size %" PRId64 "\n", - transferred_bytes, time_spent, bandwidth, max_size); + " bandwidth %g (%0.2f mbps) max_size %" PRId64 "\n", + transferred_bytes, time_spent, + bandwidth, Mbps(transferred_bytes, time_spent), max_size); /* if we haven't sent anything, we don't want to recalculate 10000 is a small enough number for our purposes */ if (s->dirty_bytes_rate && transferred_bytes > 10000) { -- 1.7.10.4