All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [Bug 1217339] [NEW] SIGQUIT to send ACPI-shutdown to Guest
@ 2013-08-27 12:29 Lasse
  2013-08-27 14:38 ` Laszlo Ersek
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Lasse @ 2013-08-27 12:29 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

When qemu receives SIGQUIT, it should first try to run system_powerdown
(giving the guest an ACPI signal to begin the shutdown process), before
ending the whole qemu process.

At this point there is no way to do a graceful shutdown if you do not
have access to the monitor and you do not use any wrapper like libvirt.

If, for some reason SIGQUIT would not be accepted as the signal, take
any free to use signal, like SIGUSR1. There should be a way to get ACPI
shutdown sent to the guest.

** Affects: qemu
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1217339

Title:
  SIGQUIT to send ACPI-shutdown to Guest

Status in QEMU:
  New

Bug description:
  When qemu receives SIGQUIT, it should first try to run
  system_powerdown (giving the guest an ACPI signal to begin the
  shutdown process), before ending the whole qemu process.

  At this point there is no way to do a graceful shutdown if you do not
  have access to the monitor and you do not use any wrapper like
  libvirt.

  If, for some reason SIGQUIT would not be accepted as the signal, take
  any free to use signal, like SIGUSR1. There should be a way to get
  ACPI shutdown sent to the guest.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1217339/+subscriptions

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Qemu-devel] [Bug 1217339] [NEW] SIGQUIT to send ACPI-shutdown to Guest
  2013-08-27 12:29 [Qemu-devel] [Bug 1217339] [NEW] SIGQUIT to send ACPI-shutdown to Guest Lasse
@ 2013-08-27 14:38 ` Laszlo Ersek
  2017-01-23 17:26 ` [Qemu-devel] [Bug 1217339] " Thomas Huth
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Laszlo Ersek @ 2013-08-27 14:38 UTC (permalink / raw)
  To: Bug 1217339; +Cc: qemu-devel

On 08/27/13 14:29, Lasse wrote:
> Public bug reported:
> 
> When qemu receives SIGQUIT, it should first try to run system_powerdown
> (giving the guest an ACPI signal to begin the shutdown process), before
> ending the whole qemu process.

I strongly disagree. SIGQUIT is an interactive debugging signal. It is
there so that the user running qemu can trigger a core dump from the
terminal, when he/she notices a problem.

http://www.gnu.org/software/libc/manual/html_node/Termination-Signals.html#index-SIGQUIT-2854

> At this point there is no way to do a graceful shutdown if you do not
> have access to the monitor and you do not use any wrapper like libvirt.
> 
> If, for some reason SIGQUIT would not be accepted as the signal, take
> any free to use signal, like SIGUSR1. There should be a way to get ACPI
> shutdown sent to the guest.

What's wrong with SIGINT / SIGTERM? Those signals are there to request a
clean shutdown (from the terminal and from an unrelated process,
respectively).

As far as I can see, both SIGINT and SIGTERM end up in
qemu_system_shutdown_request() on POSIX:

termsig_handler() [os-posix.c]
  qemu_system_killed() [vl.c]
    qemu_system_shutdown_request()

Laszlo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Qemu-devel] [Bug 1217339] Re: SIGQUIT to send ACPI-shutdown to Guest
  2013-08-27 12:29 [Qemu-devel] [Bug 1217339] [NEW] SIGQUIT to send ACPI-shutdown to Guest Lasse
  2013-08-27 14:38 ` Laszlo Ersek
@ 2017-01-23 17:26 ` Thomas Huth
  2017-03-14 16:29 ` WhiteWinterWolf
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Thomas Huth @ 2017-01-23 17:26 UTC (permalink / raw)
  To: qemu-devel

** Changed in: qemu
   Importance: Undecided => Wishlist

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1217339

Title:
  SIGQUIT to send ACPI-shutdown to Guest

Status in QEMU:
  New

Bug description:
  When qemu receives SIGQUIT, it should first try to run
  system_powerdown (giving the guest an ACPI signal to begin the
  shutdown process), before ending the whole qemu process.

  At this point there is no way to do a graceful shutdown if you do not
  have access to the monitor and you do not use any wrapper like
  libvirt.

  If, for some reason SIGQUIT would not be accepted as the signal, take
  any free to use signal, like SIGUSR1. There should be a way to get
  ACPI shutdown sent to the guest.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1217339/+subscriptions

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Qemu-devel] [Bug 1217339] Re: SIGQUIT to send ACPI-shutdown to Guest
  2013-08-27 12:29 [Qemu-devel] [Bug 1217339] [NEW] SIGQUIT to send ACPI-shutdown to Guest Lasse
  2013-08-27 14:38 ` Laszlo Ersek
  2017-01-23 17:26 ` [Qemu-devel] [Bug 1217339] " Thomas Huth
@ 2017-03-14 16:29 ` WhiteWinterWolf
  2017-03-14 17:03 ` Thomas Huth
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: WhiteWinterWolf @ 2017-03-14 16:29 UTC (permalink / raw)
  To: qemu-devel

Here is a short patch making Qemu to properly power off the guest when
receiving a SIGHUP signal.

I do not think that the way SIGTERM is handled should be modified as it
is needed to ask Qemu to forcefully close an unresponsive guest without
having to SIGKILL Qemu itself. Regarding SIGINT this is mostly a matter
of user expectation (Ctrl-C result), in doubt I keep the original
behavior.

On the other side, SIGHUP has a much flexible definition making it a
good candidate for the job.

IMHO I think such feature is really useful as it allows to cleanly close
all running VM without having to involve Qemu monitor in any way:

1. Send SIGHUP to all Qemu processes so the guests power off cleanly.
2. After a few time send SIGTERM to the remaining Qemu processes to forcefully close stuck guests.
3. After a few time send SIGKILL to the remaining Qemu processes to forcefully close stuck Qemu hypervisor processes.

I find this more convenient than having to fiddle with Qemu monitor to
implement step 1 as it must currently be done.

** Patch added: "1217339-signal_guest_shutdown.patch"
   https://bugs.launchpad.net/qemu/+bug/1217339/+attachment/4837713/+files/1217339-signal_guest_shutdown.patch

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1217339

Title:
  SIGQUIT to send ACPI-shutdown to Guest

Status in QEMU:
  New

Bug description:
  When qemu receives SIGQUIT, it should first try to run
  system_powerdown (giving the guest an ACPI signal to begin the
  shutdown process), before ending the whole qemu process.

  At this point there is no way to do a graceful shutdown if you do not
  have access to the monitor and you do not use any wrapper like
  libvirt.

  If, for some reason SIGQUIT would not be accepted as the signal, take
  any free to use signal, like SIGUSR1. There should be a way to get
  ACPI shutdown sent to the guest.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1217339/+subscriptions

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Qemu-devel] [Bug 1217339] Re: SIGQUIT to send ACPI-shutdown to Guest
  2013-08-27 12:29 [Qemu-devel] [Bug 1217339] [NEW] SIGQUIT to send ACPI-shutdown to Guest Lasse
                   ` (2 preceding siblings ...)
  2017-03-14 16:29 ` WhiteWinterWolf
@ 2017-03-14 17:03 ` Thomas Huth
  2017-03-15 15:55 ` WhiteWinterWolf
  2020-08-12 12:41 ` Laszlo Ersek (Red Hat)
  5 siblings, 0 replies; 7+ messages in thread
From: Thomas Huth @ 2017-03-14 17:03 UTC (permalink / raw)
  To: qemu-devel

Please do not add patches to the bugtracker. Post them to the mailing
list instead. See http://wiki.qemu-project.org/Contribute/SubmitAPatch
for information how to contribute a patch.

(and I am also not sure whether SIGHUP is the right signal for this job
- the original request was also about SIGQUIT instead)

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1217339

Title:
  SIGQUIT to send ACPI-shutdown to Guest

Status in QEMU:
  New

Bug description:
  When qemu receives SIGQUIT, it should first try to run
  system_powerdown (giving the guest an ACPI signal to begin the
  shutdown process), before ending the whole qemu process.

  At this point there is no way to do a graceful shutdown if you do not
  have access to the monitor and you do not use any wrapper like
  libvirt.

  If, for some reason SIGQUIT would not be accepted as the signal, take
  any free to use signal, like SIGUSR1. There should be a way to get
  ACPI shutdown sent to the guest.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1217339/+subscriptions

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Qemu-devel] [Bug 1217339] Re: SIGQUIT to send ACPI-shutdown to Guest
  2013-08-27 12:29 [Qemu-devel] [Bug 1217339] [NEW] SIGQUIT to send ACPI-shutdown to Guest Lasse
                   ` (3 preceding siblings ...)
  2017-03-14 17:03 ` Thomas Huth
@ 2017-03-15 15:55 ` WhiteWinterWolf
  2020-08-12 12:41 ` Laszlo Ersek (Red Hat)
  5 siblings, 0 replies; 7+ messages in thread
From: WhiteWinterWolf @ 2017-03-15 15:55 UTC (permalink / raw)
  To: qemu-devel

Sorry Thomas, I was not aware of this page. I checked the CODING_STYLE
file present in Qemu source before submitting this, maybe it could be
useful to include this URL there.

Meanwhile, for reference the discussion continues there:
https://lists.nongnu.org/archive/html/qemu-devel/2017-03/msg03039.html

Regards.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1217339

Title:
  SIGQUIT to send ACPI-shutdown to Guest

Status in QEMU:
  New

Bug description:
  When qemu receives SIGQUIT, it should first try to run
  system_powerdown (giving the guest an ACPI signal to begin the
  shutdown process), before ending the whole qemu process.

  At this point there is no way to do a graceful shutdown if you do not
  have access to the monitor and you do not use any wrapper like
  libvirt.

  If, for some reason SIGQUIT would not be accepted as the signal, take
  any free to use signal, like SIGUSR1. There should be a way to get
  ACPI shutdown sent to the guest.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1217339/+subscriptions

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug 1217339] Re: SIGQUIT to send ACPI-shutdown to Guest
  2013-08-27 12:29 [Qemu-devel] [Bug 1217339] [NEW] SIGQUIT to send ACPI-shutdown to Guest Lasse
                   ` (4 preceding siblings ...)
  2017-03-15 15:55 ` WhiteWinterWolf
@ 2020-08-12 12:41 ` Laszlo Ersek (Red Hat)
  5 siblings, 0 replies; 7+ messages in thread
From: Laszlo Ersek (Red Hat) @ 2020-08-12 12:41 UTC (permalink / raw)
  To: qemu-devel

The discussion noted in comment#4 petered out in March 2017. Closing
this ticket as "Invalid" (only because LP does not let me use the "Won't
Fix" resolution -- the report / feature request may very well have had
merit, but apparently a good enough design could not be found).

** Changed in: qemu
       Status: New => Invalid

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1217339

Title:
  SIGQUIT to send ACPI-shutdown to Guest

Status in QEMU:
  Invalid

Bug description:
  When qemu receives SIGQUIT, it should first try to run
  system_powerdown (giving the guest an ACPI signal to begin the
  shutdown process), before ending the whole qemu process.

  At this point there is no way to do a graceful shutdown if you do not
  have access to the monitor and you do not use any wrapper like
  libvirt.

  If, for some reason SIGQUIT would not be accepted as the signal, take
  any free to use signal, like SIGUSR1. There should be a way to get
  ACPI shutdown sent to the guest.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1217339/+subscriptions


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-08-12 12:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-27 12:29 [Qemu-devel] [Bug 1217339] [NEW] SIGQUIT to send ACPI-shutdown to Guest Lasse
2013-08-27 14:38 ` Laszlo Ersek
2017-01-23 17:26 ` [Qemu-devel] [Bug 1217339] " Thomas Huth
2017-03-14 16:29 ` WhiteWinterWolf
2017-03-14 17:03 ` Thomas Huth
2017-03-15 15:55 ` WhiteWinterWolf
2020-08-12 12:41 ` Laszlo Ersek (Red Hat)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.