From: Chenyi Qiang <chenyi.qiang(a)intel.com>
Signed-off-by: Chenyi Qiang <chenyi.qiang(a)intel.com>
---
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 == VIR_DOMAIN_LAUNCH_SECURITY_TDX) ||
+ hardRequested)
ret = qemuDomainRebootMonitor(vm, isReboot, true);
if (!ret)
@@ -3617,7 +3619,12 @@ processGuestPanicEvent(virQEMUDriver *driver,
G_GNUC_FALLTHROUGH;
case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART:
- qemuDomainSetFakeReboot(vm, true);
+ if (vm->def->sec &&
+ vm->def->sec->sectype == VIR_DOMAIN_LAUNCH_SECURITY_TDX) {
+ qemuDomainSetHardReboot(vm, true);
+ } else {
+ qemuDomainSetFakeReboot(vm, true);
+ }
qemuProcessShutdownOrReboot(vm);
break;
--
2.34.1