From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38691) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VC2iv-0000os-MR for qemu-devel@nongnu.org; Wed, 21 Aug 2013 03:21:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VC2im-00011s-A5 for qemu-devel@nongnu.org; Wed, 21 Aug 2013 03:20:57 -0400 Received: from e28smtp01.in.ibm.com ([122.248.162.1]:58527) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VC2il-00011I-Il for qemu-devel@nongnu.org; Wed, 21 Aug 2013 03:20:48 -0400 Received: from /spool/local by e28smtp01.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 21 Aug 2013 12:41:53 +0530 Received: from d28relay04.in.ibm.com (d28relay04.in.ibm.com [9.184.220.61]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id 8DF04E0054 for ; Wed, 21 Aug 2013 12:51:11 +0530 (IST) Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay04.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r7L7KcFt44892262 for ; Wed, 21 Aug 2013 12:50:38 +0530 Received: from d28av01.in.ibm.com (localhost [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r7L7KfEq027181 for ; Wed, 21 Aug 2013 12:50:41 +0530 From: Lei Li Date: Wed, 21 Aug 2013 15:18:48 +0800 Message-Id: <1377069536-12658-12-git-send-email-lilei@linux.vnet.ibm.com> In-Reply-To: <1377069536-12658-1-git-send-email-lilei@linux.vnet.ibm.com> References: <1377069536-12658-1-git-send-email-lilei@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 11/18] migration: introduce capability localhost List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aarcange@redhat.com, aliguori@us.ibm.com, Lei Li , quintela@redhat.com, mrhines@linux.vnet.ibm.com, lagarcia@br.ibm.com, pbonzini@redhat.com, rcj@linux.vnet.ibm.com Introduce migration capability localhost. Signed-off-by: Lei Li --- include/migration/migration.h | 3 +++ migration.c | 12 ++++++++++++ qapi-schema.json | 8 +++++++- 3 files changed, 22 insertions(+), 1 deletions(-) diff --git a/include/migration/migration.h b/include/migration/migration.h index d2c7eff..a04f050 100644 --- a/include/migration/migration.h +++ b/include/migration/migration.h @@ -143,10 +143,13 @@ void migrate_add_blocker(Error *reason); void migrate_del_blocker(Error *reason); bool migrate_rdma_pin_all(void); + bool migrate_zero_blocks(void); bool migrate_auto_converge(void); +bool migrate_is_localhost(void); + int xbzrle_encode_buffer(uint8_t *old_buf, uint8_t *new_buf, int slen, uint8_t *dst, int dlen); int xbzrle_decode_buffer(uint8_t *src, int slen, uint8_t *dst, int dlen); diff --git a/migration.c b/migration.c index 2446a6a..2f85358 100644 --- a/migration.c +++ b/migration.c @@ -420,6 +420,9 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, } else if (strstart(uri, "exec:", &p)) { exec_start_outgoing_migration(s, p, &local_err); } else if (strstart(uri, "unix:", &p)) { + if (s->enabled_capabilities[MIGRATION_CAPABILITY_LOCALHOST]) { + local_start_outgoing_migration(s, p, &local_err); + } unix_start_outgoing_migration(s, p, &local_err); } else if (strstart(uri, "fd:", &p)) { fd_start_outgoing_migration(s, p, &local_err); @@ -521,6 +524,15 @@ int migrate_use_xbzrle(void) return s->enabled_capabilities[MIGRATION_CAPABILITY_XBZRLE]; } +bool migrate_is_localhost(void) +{ + MigrationState *s; + + s = migrate_get_current(); + + return s->enabled_capabilities[MIGRATION_CAPABILITY_LOCALHOST]; +} + int64_t migrate_xbzrle_cache_size(void) { MigrationState *s; diff --git a/qapi-schema.json b/qapi-schema.json index a51f7d2..557337f 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -629,10 +629,16 @@ # @auto-converge: If enabled, QEMU will automatically throttle down the guest # to speed up convergence of RAM migration. (since 1.6) # +# @localhost: If enabled, QEMU will support localhost migration. This feature +# allows live upgrade of a running QEMU instance by doing localhost +# migration with page flipping. It requires the source and destination +# are both on localhost. Disabled by default. (since 1.7) +# # Since: 1.2 ## { 'enum': 'MigrationCapability', - 'data': ['xbzrle', 'x-rdma-pin-all', 'auto-converge', 'zero-blocks'] } + 'data': ['xbzrle', 'x-rdma-pin-all', 'auto-converge', 'zero-blocks', + 'localhost'] } ## # @MigrationCapabilityStatus -- 1.7.7.6