From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46849) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XilSj-0002VF-My for qemu-devel@nongnu.org; Mon, 27 Oct 2014 10:40:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XilSe-0006G1-RF for qemu-devel@nongnu.org; Mon, 27 Oct 2014 10:40:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36652) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XilSe-0006Fv-If for qemu-devel@nongnu.org; Mon, 27 Oct 2014 10:39:56 -0400 Message-ID: <544E5931.9070301@redhat.com> Date: Mon, 27 Oct 2014 15:39:45 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <544CBFB0.7010701@web.de> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Revert "main-loop.c: Handle SIGINT, SIGHUP and SIGTERM, synchronously" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , Jan Kiszka Cc: =?UTF-8?B?QWxleCBCZW5uw6ll?= , qemu-devel , Stefan Hajnoczi , Gonglei On 10/27/2014 03:18 PM, Peter Maydell wrote: > On 26 October 2014 09:32, Jan Kiszka wrote: >> From: Jan Kiszka >> >> This reverts commit 15124e142034d21341ec9f1a304a1dc5a6c25681. It breaks >> debuggability of qemu. >> >> Signed-off-by: Jan Kiszka >> --- >> >> Feel free to apply this before or after "Make qemu_shutdown_requested >> signal-safe". >> >> main-loop.c | 3 --- >> 1 file changed, 3 deletions(-) >> >> diff --git a/main-loop.c b/main-loop.c >> index d2e64f1..53393a4 100644 >> --- a/main-loop.c >> +++ b/main-loop.c >> @@ -84,9 +84,6 @@ static int qemu_signal_init(void) >> sigaddset(&set, SIGIO); >> sigaddset(&set, SIGALRM); >> sigaddset(&set, SIGBUS); >> - sigaddset(&set, SIGINT); >> - sigaddset(&set, SIGHUP); >> - sigaddset(&set, SIGTERM); > > I'm planning to apply this patch but with the following > comment added here: > /* Note that the SIGINT, SIGTERM and SIGHUP signals are not handled > * via signalfd, and so their handlers will still be invoked > * asynchronously. This is done so that ^C can be used to interrupt > * QEMU when it is being run under gdb. > */ What about: /* SIGINT cannot be handled via signalfd, so that ^C can be used * to interrupt QEMU when it is being run under gdb. SIGHUP and * SIGTERM are also handled asynchronously, even though it is not * strictly necessary, because they use the same handler as SIGINT. */ > (which does make the commit not a pure revert). > >> pthread_sigmask(SIG_BLOCK, &set, NULL); >> >> sigdelset(&set, SIG_IPI); >> -- >> 1.8.4.5 > > thanks > -- PMM >