From: Stefan Hajnoczi <stefanha@gmail.com>
To: andrewjameswood@ymail.com
Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org,
Andrew Wood <awood@comms.org.uk>,
Daniel Berrange <berrange@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] Added SIGPWR handler to send ACPI shutdown
Date: Mon, 14 May 2018 14:52:40 +0100 [thread overview]
Message-ID: <20180514135240.GE5182@stefanha-x1.localdomain> (raw)
In-Reply-To: <20180511203238.22881-1-andrewjameswood@ymail.com>
[-- Attachment #1: Type: text/plain, Size: 1639 bytes --]
On Fri, May 11, 2018 at 09:32:38PM +0100, andrewjameswood--- via Qemu-devel wrote:
> From: Andrew Wood <awood@comms.org.uk>
>
> Signed-off-by: Andrew Wood <awood@comms.org.uk>
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
>
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
prev parent reply other threads:[~2018-05-14 13:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-11 20:32 [Qemu-devel] [PATCH] Added SIGPWR handler to send ACPI shutdown andrewjameswood
2018-05-11 20:35 ` no-reply
2018-05-11 20:37 ` no-reply
2018-05-14 13:52 ` Stefan Hajnoczi [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180514135240.GE5182@stefanha-x1.localdomain \
--to=stefanha@gmail.com \
--cc=andrewjameswood@ymail.com \
--cc=awood@comms.org.uk \
--cc=berrange@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).