-----Original Message-----
From: Daniel P. Berrangé <berrange(a)redhat.com>
Subject: Re: [PATCH rfcv3 08/11] qemu: make hard reboot as the TDX
default reboot mode
On Mon, Nov 27, 2023 at 04:55:18PM +0800, Zhenzhong Duan wrote:
> 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);
I suspect we'll need todo this with SEV too, since IIUC it does not
permit soft reboot either.
Yes, unluckily I have no SEV env to see if hard reboot also works for SEV.
Thanks
Zhenzhong