From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWMLI-0001so-5X for qemu-devel@nongnu.org; Tue, 23 Sep 2014 05:25:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XWMLA-000881-04 for qemu-devel@nongnu.org; Tue, 23 Sep 2014 05:25:04 -0400 Received: from [59.151.112.132] (port=56236 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XWML9-00084T-J9 for qemu-devel@nongnu.org; Tue, 23 Sep 2014 05:24:55 -0400 From: Yang Hongyang Date: Tue, 23 Sep 2014 17:23:36 +0800 Message-ID: <1411464235-5653-5-git-send-email-yanghy@cn.fujitsu.com> In-Reply-To: <1411464235-5653-1-git-send-email-yanghy@cn.fujitsu.com> References: <1411464235-5653-1-git-send-email-yanghy@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [RFC PATCH v2 04/23] 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: GuiJianfeng@cn.fujitsu.com, yunhong.jiang@intel.com, eddie.dong@intel.com, dgilbert@redhat.com, mrhines@linux.vnet.ibm.com, yanghy@cn.fujitsu.com 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 --- migration.c | 8 ++++++++ qapi-schema.json | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/migration.c b/migration.c index 8d675b3..5d28237 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,13 @@ 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_setg(errp, "COLO is not currently supported, please rerun" + " configure with --enable-colo option in order to" + " support COLO feature"); + continue; + } s->enabled_capabilities[cap->value->capability] = cap->value->state; } } diff --git a/qapi-schema.json b/qapi-schema.json index 689b548..8d58ef7 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: If enabled, the migration will never end, and the VM will instead be +# continuously checkpointed. (since 2.2) +# # 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