From nobody Mon Feb 9 16:02:41 2026 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=intel.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1701076375685812.9158140488174; Mon, 27 Nov 2023 01:12:55 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 1D735197B; Mon, 27 Nov 2023 04:12:55 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 706B11A1E; Mon, 27 Nov 2023 04:00:30 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id BACDF1996; Mon, 27 Nov 2023 03:59:42 -0500 (EST) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id A4EAF1947 for ; Mon, 27 Nov 2023 03:58:42 -0500 (EST) Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2023 00:57:36 -0800 Received: from spr-s2600bt.bj.intel.com ([10.240.192.124]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Nov 2023 00:57:33 -0800 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-IronPort-AV: E=McAfee;i="6600,9927,10906"; a="392413797" X-IronPort-AV: E=Sophos;i="6.04,230,1695711600"; d="scan'208";a="392413797" X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,230,1695711600"; d="scan'208";a="9716793" From: Zhenzhong Duan To: devel@lists.libvirt.org Subject: [PATCH rfcv3 08/11] qemu: make hard reboot as the TDX default reboot mode Date: Mon, 27 Nov 2023 16:55:18 +0800 Message-Id: <20231127085521.6813-9-zhenzhong.duan@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231127085521.6813-1-zhenzhong.duan@intel.com> References: <20231127085521.6813-1-zhenzhong.duan@intel.com> MIME-Version: 1.0 Message-ID-Hash: N73ALVJNKNAJN2P4VO2EPVRZBWXIPJF7 X-Message-ID-Hash: N73ALVJNKNAJN2P4VO2EPVRZBWXIPJF7 X-MailFrom: zhenzhong.duan@intel.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0 CC: phrdina@redhat.com, pkrempa@redhat.com, jjongsma@redhat.com, jsuchane@redhat.com, chenyi.qiang@intel.com, isaku.yamahata@intel.com, xiaoyao.li@intel.com, chao.p.peng@intel.com, edwin.zhai@intel.com X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1701076376413000001 From: Chenyi Qiang Signed-off-by: Chenyi Qiang --- src/qemu/qemu_driver.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 86e8efbfcb..ba1bb4ecb1 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -2013,7 +2013,9 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flags) /* Take hard reboot as the highest priority. * This is for TDX which is not allowed to warm reboot. */ - if (hardRequested) + if ((vm->def->sec && + vm->def->sec->sectype =3D=3D VIR_DOMAIN_LAUNCH_SECURITY_TDX) || + hardRequested) ret =3D qemuDomainRebootMonitor(vm, isReboot, true); =20 if (!ret) @@ -3617,7 +3619,12 @@ processGuestPanicEvent(virQEMUDriver *driver, G_GNUC_FALLTHROUGH; =20 case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART: - qemuDomainSetFakeReboot(vm, true); + if (vm->def->sec && + vm->def->sec->sectype =3D=3D VIR_DOMAIN_LAUNCH_SECURITY_TDX) { + qemuDomainSetHardReboot(vm, true); + } else { + qemuDomainSetFakeReboot(vm, true); + } qemuProcessShutdownOrReboot(vm); break; =20 --=20 2.34.1 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org