[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Added SIGPWR handler to send ACPI shutdown
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH] Added SIGPWR handler to send ACPI shutdown |
Date: |
Mon, 14 May 2018 14:52:40 +0100 |
User-agent: |
Mutt/1.9.5 (2018-04-13) |
On Fri, May 11, 2018 at 09:32:38PM +0100, andrewjameswood--- via Qemu-devel
wrote:
> From: Andrew Wood <address@hidden>
>
> Signed-off-by: Andrew Wood <address@hidden>
Thanks!
Please include a commit description to give the rationale for this
change.
Please address coding style issues. You can run the checker like this:
$ scripts/checkpatch.pl HEAD^..
> ---
> os-posix.c | 1 +
> vl.c | 13 +++++++++++--
> 2 files changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/os-posix.c b/os-posix.c
> index b9c2343b1e..68d70f269b 100644
> --- a/os-posix.c
> +++ b/os-posix.c
> @@ -70,6 +70,7 @@ void os_setup_signal_handling(void)
> sigaction(SIGINT, &act, NULL);
> sigaction(SIGHUP, &act, NULL);
> sigaction(SIGTERM, &act, NULL);
> + sigaction(SIGPWR, &act, NULL);
> }
>
> /* Find a likely location for support files using the location of the binary.
> diff --git a/vl.c b/vl.c
> index fce1fd12d8..55c5e06858 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -1846,8 +1846,17 @@ void qemu_system_killed(int signal, pid_t pid)
> /* Cannot call qemu_system_shutdown_request directly because
> * we are in a signal handler.
> */
> - shutdown_requested = SHUTDOWN_CAUSE_HOST_SIGNAL;
> - qemu_notify_event();
> + if (signal==SIGPWR)
> + {
> +
> + powerdown_requested = 1;
> + qemu_notify_event();
> + }
> + else
> + {
> + shutdown_requested = SHUTDOWN_CAUSE_HOST_SIGNAL;
> + qemu_notify_event();
> + }
> }
>
> void qemu_system_shutdown_request(ShutdownCause reason)
> --
> 2.11.0
>
>
signature.asc
Description: PGP signature