From: Jan Psota <jasiupsota@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] qemu-kvm guest shutdown on signal -- patch
Date: Thu, 10 Dec 2009 12:33:44 +0100 [thread overview]
Message-ID: <233e0fa20912100333s38992cb0w2f956016049b5b3@mail.gmail.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 387 bytes --]
It would be useful if you include this addition to qemu code.
I often use Windows on virtual qemu machines and I think that there is
no more elegant way to shut them down (any other OS too!), than by
killing qemu with signal it does not use for other purposes.
// termsig_handler() is not consistent with other _handler names,
// it would look better as sigterm_handler()
--
Jan Psota
[-- Attachment #1.2: Type: text/html, Size: 516 bytes --]
[-- Attachment #2: acpi_poweroff_on_sigquit.patch --]
[-- Type: text/x-patch, Size: 610 bytes --]
--- vl.c.orig 2009-09-23 09:30:02.000000000 +0200
+++ vl.c 2009-12-08 21:31:57.275033029 +0100
@@ -4742,6 +4742,11 @@
qemu_system_shutdown_request();
}
+static void sigquit_handler(int signal)
+{
+ qemu_system_powerdown_request();
+}
+
static void sigchld_handler(int signal)
{
waitpid(-1, NULL, WNOHANG);
@@ -4757,6 +4762,9 @@
sigaction(SIGHUP, &act, NULL);
sigaction(SIGTERM, &act, NULL);
+ act.sa_handler = sigquit_handler;
+ sigaction(SIGQUIT, &act, NULL);
+
act.sa_handler = sigchld_handler;
act.sa_flags = SA_NOCLDSTOP;
sigaction(SIGCHLD, &act, NULL);
reply other threads:[~2009-12-10 11:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=233e0fa20912100333s38992cb0w2f956016049b5b3@mail.gmail.com \
--to=jasiupsota@gmail.com \
--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).