qemu-trivial
[Top][All Lists]
Advanced

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

Re: [PATCH 1/5] log: Add logs for vm start and destroy


From: Thomas Huth
Subject: Re: [PATCH 1/5] log: Add logs for vm start and destroy
Date: Thu, 6 Aug 2020 12:07:48 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

On 06/08/2020 11.37, Peng Liang wrote:
> Add logs for vm start and destroy.
> 
> Signed-off-by: Peng Liang <liangpeng10@huawei.com>
> ---
>  hw/acpi/core.c  | 3 +++
>  hw/core/reset.c | 2 ++
>  softmmu/vl.c    | 8 ++++++++
>  3 files changed, 13 insertions(+)
> 
> diff --git a/hw/acpi/core.c b/hw/acpi/core.c
> index ac06db3450..0a24f018cf 100644
> --- a/hw/acpi/core.c
> +++ b/hw/acpi/core.c
> @@ -560,13 +560,16 @@ static void acpi_pm1_cnt_write(ACPIREGS *ar, uint16_t 
> val)
>          uint16_t sus_typ = (val >> 10) & 7;
>          switch(sus_typ) {
>          case 0: /* soft power off */
> +            info_report("VM will be soft power off");
>              qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);
>              break;
>          case 1:
> +            info_report("VM will be suspend state");
>              qemu_system_suspend_request();
>              break;
>          default:
>              if (sus_typ == ar->pm1.cnt.s4_val) { /* S4 request */
> +                info_report("VM will be S4 state");
>                  qapi_event_send_suspend_disk();
>                  qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN);
>              }

There is already a trace point in qemu_system_shutdown_request(), so
this can already be used instead.

 Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]