From patchwork Fri Apr 1 03:46:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Chen X-Patchwork-Id: 12797904 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4A005C4332F for ; Fri, 1 Apr 2022 04:02:23 +0000 (UTC) Received: from localhost ([::1]:56146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1na8UQ-0004wk-Br for qemu-devel@archiver.kernel.org; Fri, 01 Apr 2022 00:02:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38004) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1na8RR-0001yi-Vq for qemu-devel@nongnu.org; Thu, 31 Mar 2022 23:59:18 -0400 Received: from mga18.intel.com ([134.134.136.126]:51138) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1na8RN-0002s0-N5 for qemu-devel@nongnu.org; Thu, 31 Mar 2022 23:59:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1648785553; x=1680321553; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YLdF6NpOTfWp3qwGIAirD8aN2gGJUzJV8ptPQOvJvkI=; b=acqzN79DvkANOTYQZUVKidxQLr5ii9YqkhO7FpXP2GBaf9QBv79GgKc2 2aX6VY/AMAjR4ppPFCTlKCjjDVIbAWQJGBjOYUtA0kTIeqIMlSGvBkxOE 1rzQB6+/jbWkIxKweCYTkfkca6ZzBrupi+ZEIZ8gRtQ7aFRlQR8h8rnLr JK++3m573UUC2Vz6YKKrfBoeVl6cA3+ubwYFtYytEuR1/w1m476rDORTJ AakJ2IdpWVMaHbqdhuQyHkVmUx6UkiN0RBflO+LbCE64dD9E4++7OxiSn 6L1oJOTgYeR1TAEFKFcS7y3B3AB1xMQmYIHYOUo6XsW8J/U30zxUmkXkU A==; X-IronPort-AV: E=McAfee;i="6200,9189,10303"; a="242182895" X-IronPort-AV: E=Sophos;i="5.90,226,1643702400"; d="scan'208";a="242182895" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2022 20:59:11 -0700 X-IronPort-AV: E=Sophos;i="5.90,226,1643702400"; d="scan'208";a="567105814" Received: from unknown (HELO localhost.localdomain) ([10.239.13.19]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 Mar 2022 20:59:09 -0700 From: Zhang Chen To: Jason Wang , Li Zhijian Subject: [PATCH V2 1/4] softmmu/runstate.c: add RunStateTransition support form COLO to PRELAUNCH Date: Fri, 1 Apr 2022 11:46:59 +0800 Message-Id: <20220401034702.687057-2-chen.zhang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220401034702.687057-1-chen.zhang@intel.com> References: <20220401034702.687057-1-chen.zhang@intel.com> MIME-Version: 1.0 Received-SPF: pass client-ip=134.134.136.126; envelope-from=chen.zhang@intel.com; helo=mga18.intel.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Zhang Chen , qemu-dev , Like Xu Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" If the checkpoint occurs when the guest finishes restarting but has not started running, the runstate_set() may reject the transition from COLO to PRELAUNCH with the crash log: {"timestamp": {"seconds": 1593484591, "microseconds": 26605},\ "event": "RESET", "data": {"guest": true, "reason": "guest-reset"}} qemu-system-x86_64: invalid runstate transition: 'colo' -> 'prelaunch' Long-term testing says that it's pretty safe. Signed-off-by: Like Xu Signed-off-by: Zhang Chen Acked-by: Dr. David Alan Gilbert --- softmmu/runstate.c | 1 + 1 file changed, 1 insertion(+) diff --git a/softmmu/runstate.c b/softmmu/runstate.c index e0d869b21a..c021c56338 100644 --- a/softmmu/runstate.c +++ b/softmmu/runstate.c @@ -127,6 +127,7 @@ static const RunStateTransition runstate_transitions_def[] = { { RUN_STATE_RESTORE_VM, RUN_STATE_PRELAUNCH }, { RUN_STATE_COLO, RUN_STATE_RUNNING }, + { RUN_STATE_COLO, RUN_STATE_PRELAUNCH }, { RUN_STATE_COLO, RUN_STATE_SHUTDOWN}, { RUN_STATE_RUNNING, RUN_STATE_DEBUG },