[Top][All Lists]

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

[Qemu-devel] [Bug 1217339] Re: SIGQUIT to send ACPI-shutdown to Guest

From: WhiteWinterWolf
Subject: [Qemu-devel] [Bug 1217339] Re: SIGQUIT to send ACPI-shutdown to Guest
Date: Tue, 14 Mar 2017 16:29:41 -0000

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

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"

You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.

  SIGQUIT to send ACPI-shutdown to Guest

Status in QEMU:

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

  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:

reply via email to

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