From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37364) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEKNU-0006o5-Jn for qemu-devel@nongnu.org; Tue, 27 Aug 2013 10:36:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VEKNP-0003I6-SK for qemu-devel@nongnu.org; Tue, 27 Aug 2013 10:36:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42646) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VEKNP-0003Hn-LI for qemu-devel@nongnu.org; Tue, 27 Aug 2013 10:36:11 -0400 Message-ID: <521CB9ED.4030802@redhat.com> Date: Tue, 27 Aug 2013 16:38:37 +0200 From: Laszlo Ersek MIME-Version: 1.0 References: <20130827122907.17435.24292.malonedeb@gac.canonical.com> <20130827122907.17435.24292.malonedeb@gac.canonical.com> In-Reply-To: <20130827122907.17435.24292.malonedeb@gac.canonical.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Bug 1217339] [NEW] SIGQUIT to send ACPI-shutdown to Guest List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bug 1217339 <1217339@bugs.launchpad.net> Cc: qemu-devel@nongnu.org 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