From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48131) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X9xUX-00071d-Hz for qemu-devel@nongnu.org; Wed, 23 Jul 2014 10:26:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X9xUR-0005tc-Hn for qemu-devel@nongnu.org; Wed, 23 Jul 2014 10:26:01 -0400 Received: from [59.151.112.132] (port=39249 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X9xUR-0005sC-4F for qemu-devel@nongnu.org; Wed, 23 Jul 2014 10:25:55 -0400 From: Yang Hongyang Date: Wed, 23 Jul 2014 22:25:24 +0800 Message-ID: <1406125538-27992-4-git-send-email-yanghy@cn.fujitsu.com> In-Reply-To: <1406125538-27992-1-git-send-email-yanghy@cn.fujitsu.com> References: <1406125538-27992-1-git-send-email-yanghy@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [RFC PATCH 03/17] COLO migration: add a migration capability 'colo' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, GuiJianfeng@cn.fujitsu.com, eddie.dong@intel.com, dgilbert@redhat.com, mrhines@linux.vnet.ibm.com, Yang Hongyang Add a migration capability 'colo'. If this capability is on, The migration will never end, and the VM will be continuously checkpointed. Signed-off-by: Yang Hongyang --- include/qapi/qmp/qerror.h | 3 +++ migration.c | 6 ++++++ qapi-schema.json | 5 ++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h index 902d1a7..226b805 100644 --- a/include/qapi/qmp/qerror.h +++ b/include/qapi/qmp/qerror.h @@ -166,4 +166,7 @@ void qerror_report_err(Error *err); #define QERR_SOCKET_CREATE_FAILED \ ERROR_CLASS_GENERIC_ERROR, "Failed to create socket" +#define QERR_COLO_UNSUPPORTED \ + ERROR_CLASS_GENERIC_ERROR, "COLO is not currently supported, please rerun configure with --enable-colo option in order to support COLO feature" + #endif /* QERROR_H */ diff --git a/migration.c b/migration.c index 8d675b3..ca83310 100644 --- a/migration.c +++ b/migration.c @@ -25,6 +25,7 @@ #include "qemu/thread.h" #include "qmp-commands.h" #include "trace.h" +#include "migration/migration-colo.h" enum { MIG_STATE_ERROR = -1, @@ -277,6 +278,11 @@ void qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params, } for (cap = params; cap; cap = cap->next) { + if (cap->value->capability == MIGRATION_CAPABILITY_COLO && + cap->value->state && !colo_supported()) { + error_set(errp, QERR_COLO_UNSUPPORTED); + continue; + } s->enabled_capabilities[cap->value->capability] = cap->value->state; } } diff --git a/qapi-schema.json b/qapi-schema.json index b11aad2..807f5a2 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -491,10 +491,13 @@ # @auto-converge: If enabled, QEMU will automatically throttle down the guest # to speed up convergence of RAM migration. (since 1.6) # +# @colo: The migration will never end, and the VM will instead be continuously +# checkpointed. The feature is disabled by default. (since 2.1) +# # Since: 1.2 ## { 'enum': 'MigrationCapability', - 'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks'] } + 'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks', 'colo'] } ## # @MigrationCapabilityStatus -- 1.9.1