[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC V2 PATCH 11/11] arm/virt: enable sleep support
From: |
Peter Maydell |
Subject: |
Re: [RFC V2 PATCH 11/11] arm/virt: enable sleep support |
Date: |
Tue, 8 Oct 2024 12:53:20 +0100 |
On Fri, 27 Sept 2024 at 19:40, Annie Li <annie.li@oracle.com> wrote:
>
> From: Miguel Luis <miguel.luis@oracle.com>
>
> For reference: qmp_system_sleep relies on wakeup support delegated
> by qemu_wakeup_suspend_enabled() hence the need for calling
> qemu_register_wakeup_support(). With this, we should be able to
> issue QMP system_sleep command now.
>
> Signed-off-by: Miguel Luis <miguel.luis@oracle.com>
> ---
> hw/arm/virt.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 6be80f042f..370ee4fe7f 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -2403,6 +2403,7 @@ static void machvirt_init(MachineState *machine)
>
> /* connect sleep request */
> vms->sleep_notifier.notify = virt_sleep_req;
> + qemu_register_wakeup_support();
On i386 the machine has a MachineClass::wakeup method
(pc_machine_wakeup) that does things on wakeup.
On ppc/spapr there is this comment before the call
to qemu_register_wakeup_support():
/*
* Nothing needs to be done to resume a suspended guest because
* suspending does not change the machine state, so no need for
* a ->wakeup method.
*/
I think that for Arm we need to determine whether the virt
board is like i386/pc (need to do something on wakeup) or
like ppc/spapr (don't need to do anything on wakeup). If the
former, we obviously would need to implement the
MachineClass::wakeup method; if the latter, then we
should have a comment explaining why there doesn't need
to be any action taken on resume and therefore the machine
has no wakeup method.
thanks
-- PMM
- Re: [RFC V2 PATCH 11/11] arm/virt: enable sleep support,
Peter Maydell <=