Re: [PATCH rfcv3 08/11] qemu: make hard reboot as the TDX default reboot mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 27, 2023 at 04:55:18PM +0800, Zhenzhong Duan wrote:
> From: Chenyi Qiang <chenyi.qiang@xxxxxxxxx>
> 
> Signed-off-by: Chenyi Qiang <chenyi.qiang@xxxxxxxxx>
> ---
>  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.

>          break;
>  
> -- 
> 2.34.1
> 

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux