From nobody Mon Feb 9 07:23:36 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1602827883; cv=none; d=zohomail.com; s=zohoarc; b=nowtiOjVUZeEZU9RYzhmvgnKOfUc8NaM2oKz/jGU2T/jXANeqeBOvXvuQ2E8LSaVj3NE8xaHhylph7SQlV8swjSf9wtCVtmqSE1DXna+L9yLfPGkktAnYfr5hajLPoDsxesC8zTtaY1pUdPz0FqKsTgHODtd0Vx90vxUFVXRCMo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602827883; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=ztHUoFyFLbnoemN6LU4ARzwW7mIAlWQdHA5QLy0AT2I=; b=kZG+GlZKrdObp7NPXBNVcVtS+85/T4gwHph0FjH5jhm1DCUmAGiLGSTAZCWsf/Rhtq8pcMcZM4DvgQwUCSSVU3lOpIcsvxPDFLawSYeHfoN3LnIT46YHh0DrSEQRZB5rmuBC/5x2lhFbVuqS/hp5/YO/pPmZoBGF3PHn2SlZoso= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 160282788340087.12135341940768; Thu, 15 Oct 2020 22:58:03 -0700 (PDT) Received: from localhost ([::1]:42070 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kTIkc-0002cB-9I for importer@patchew.org; Fri, 16 Oct 2020 01:58:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kTIhT-0006JC-48 for qemu-devel@nongnu.org; Fri, 16 Oct 2020 01:54:47 -0400 Received: from mga01.intel.com ([192.55.52.88]:36617) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kTIhR-0005C7-Hk for qemu-devel@nongnu.org; Fri, 16 Oct 2020 01:54:46 -0400 Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Oct 2020 22:54:44 -0700 Received: from unknown (HELO localhost.localdomain) ([10.239.13.19]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Oct 2020 22:54:42 -0700 IronPort-SDR: qhCR6FnwBL6wZT3EqVwYNoZUS4HtPiwbmauTbIMQMhLeJlkn1/dYUTVzPrbEj+ka6eb75Gr45p GTGxtlc8We+A== X-IronPort-AV: E=McAfee;i="6000,8403,9775"; a="184094655" X-IronPort-AV: E=Sophos;i="5.77,381,1596524400"; d="scan'208";a="184094655" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False IronPort-SDR: 6ZTsQoFIb753XQyv7gYci9aFzLYF7fHKUBD6MnQmKhUun16t5dF73QHA8aX0cey3YrdbYYa+h7 wbpyG7A8qKvg== X-IronPort-AV: E=Sophos;i="5.77,381,1596524400"; d="scan'208";a="464572829" From: Zhang Chen To: Jason Wang , qemu-dev Subject: [PATCH V2 04/10] Fix the qemu crash when guest shutdown in COLO mode Date: Fri, 16 Oct 2020 13:52:02 +0800 Message-Id: <20201016055208.7969-5-chen.zhang@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201016055208.7969-1-chen.zhang@intel.com> References: <20201016055208.7969-1-chen.zhang@intel.com> Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=192.55.52.88; envelope-from=chen.zhang@intel.com; helo=mga01.intel.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/16 01:54:36 X-ACL-Warn: Detected OS = FreeBSD 9.x or newer [fuzzy] X-Spam_score_int: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, FROM_ADDR_WS=2.996, FROM_WSP_TRAIL=1, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Derek Su , Zhang Chen , "Rao, Lei" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Zhang Chen Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Rao, Lei" In COLO mode, if the startup parameters of QEMU include "no-shutdown", QEMU will crash when the guest shutdown. The root cause is when the guest shutdown, the state of VM will switch COLO to SHUTDOWN. When do checkpoint again, the state will be changed to COLO. But the state switch is undefined in runstate_transitions_def, we should add it. This patch fixes the following: qemu-system-x86_64: invalid runstate transition: 'shutdown' -> 'colo' Aborted Signed-off-by: Lei Rao Signed-off-by: Zhang Chen Reviewed-by: Zhang Chen --- softmmu/vl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/softmmu/vl.c b/softmmu/vl.c index 5a11a62f78..bafe7c5b70 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -632,6 +632,7 @@ static const RunStateTransition runstate_transitions_de= f[] =3D { { RUN_STATE_SHUTDOWN, RUN_STATE_PAUSED }, { RUN_STATE_SHUTDOWN, RUN_STATE_FINISH_MIGRATE }, { RUN_STATE_SHUTDOWN, RUN_STATE_PRELAUNCH }, + { RUN_STATE_SHUTDOWN, RUN_STATE_COLO }, =20 { RUN_STATE_DEBUG, RUN_STATE_SUSPENDED }, { RUN_STATE_RUNNING, RUN_STATE_SUSPENDED }, --=20 2.17.1