From patchwork Sun Mar 3 14:50:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Chen" X-Patchwork-Id: 1050873 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44C67P389qz9s1B for ; Mon, 4 Mar 2019 02:11:29 +1100 (AEDT) Received: from localhost ([127.0.0.1]:40524 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0Slz-0000VD-8B for incoming@patchwork.ozlabs.org; Sun, 03 Mar 2019 10:11:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50027) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h0SiO-0006Fd-P4 for qemu-devel@nongnu.org; Sun, 03 Mar 2019 10:07:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h0SUv-00066T-56 for qemu-devel@nongnu.org; Sun, 03 Mar 2019 09:53:49 -0500 Received: from mga09.intel.com ([134.134.136.24]:42882) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h0SUu-0005rf-Su for qemu-devel@nongnu.org; Sun, 03 Mar 2019 09:53:49 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Mar 2019 06:53:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,436,1544515200"; d="scan'208";a="325005922" Received: from unknown (HELO localhost.localdomain) ([10.239.13.19]) by fmsmga005.fm.intel.com with ESMTP; 03 Mar 2019 06:53:46 -0800 From: Zhang Chen To: Li Zhijian , Zhang Chen , "Dr. David Alan Gilbert" , Juan Quintela , zhanghailiang , Markus Armbruster , Eric Blake , qemu-dev Date: Sun, 3 Mar 2019 22:50:16 +0800 Message-Id: <20190303145021.2962-3-chen.zhang@intel.com> X-Mailer: git-send-email 2.17.GIT In-Reply-To: <20190303145021.2962-1-chen.zhang@intel.com> References: <20190303145021.2962-1-chen.zhang@intel.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 134.134.136.24 Subject: [Qemu-devel] [PATCH V3 2/7] Migration/colo.c: Fix COLO failover status error X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zhang Chen Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Zhang Chen When finished COLO failover, the status is FAILOVER_STATUS_COMPLETED. The origin codes misunderstand the FAILOVER_STATUS_REQUIRE. Signed-off-by: Zhang Chen Reviewed-by: Dr. David Alan Gilbert --- migration/colo.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/migration/colo.c b/migration/colo.c index a916dc178c..a13acac192 100644 --- a/migration/colo.c +++ b/migration/colo.c @@ -121,6 +121,7 @@ static void secondary_vm_do_failover(void) } /* Notify COLO incoming thread that failover work is finished */ qemu_sem_post(&mis->colo_incoming_sem); + /* For Secondary VM, jump to incoming co */ if (mis->migration_incoming_co) { qemu_coroutine_enter(mis->migration_incoming_co); @@ -262,7 +263,7 @@ COLOStatus *qmp_query_colo_status(Error **errp) case FAILOVER_STATUS_NONE: s->reason = COLO_EXIT_REASON_NONE; break; - case FAILOVER_STATUS_REQUIRE: + case FAILOVER_STATUS_COMPLETED: s->reason = COLO_EXIT_REASON_REQUEST; break; default: @@ -582,7 +583,7 @@ out: qapi_event_send_colo_exit(COLO_MODE_PRIMARY, COLO_EXIT_REASON_ERROR); break; - case FAILOVER_STATUS_REQUIRE: + case FAILOVER_STATUS_COMPLETED: qapi_event_send_colo_exit(COLO_MODE_PRIMARY, COLO_EXIT_REASON_REQUEST); break; @@ -854,7 +855,7 @@ out: qapi_event_send_colo_exit(COLO_MODE_SECONDARY, COLO_EXIT_REASON_ERROR); break; - case FAILOVER_STATUS_REQUIRE: + case FAILOVER_STATUS_COMPLETED: qapi_event_send_colo_exit(COLO_MODE_SECONDARY, COLO_EXIT_REASON_REQUEST); break;