From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:33399) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWWly-0000LK-3G for qemu-devel@nongnu.org; Tue, 14 Jun 2011 12:47:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QWWlw-00048P-9F for qemu-devel@nongnu.org; Tue, 14 Jun 2011 12:47:25 -0400 Received: from goliath.siemens.de ([192.35.17.28]:29098) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWWlv-00047v-Ig for qemu-devel@nongnu.org; Tue, 14 Jun 2011 12:47:23 -0400 Message-ID: <4DF79097.5000501@siemens.com> Date: Tue, 14 Jun 2011 18:47:19 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <1308060336-608-1-git-send-email-cerbere@gmail.com> In-Reply-To: <1308060336-608-1-git-send-email-cerbere@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] Fix signal handling when io-thread is disabled List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexandre Raymond Cc: "pbonzini@redhat.com" , "andreas.faerber@web.de" , "qemu-devel@nongnu.org" , "agraf@suse.de" On 2011-06-14 16:05, Alexandre Raymond wrote: > Changes since v1: > - take pthread_sigmask() out of the ifdef as it is now common > to both parts. > > This fix effectively blocks, in the main thread, the signals handled > by signalfd or the compatibility signal thread. > > This way, such signals are received synchronously in the main thread > through sigfd_handler() instead of triggering the signal handler > directly, asynchronously. > > Signed-off-by: Alexandre Raymond > --- > cpus.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/cpus.c b/cpus.c > index 4ab76f0..18a1522 100644 > --- a/cpus.c > +++ b/cpus.c > @@ -399,7 +399,6 @@ static int qemu_signal_init(void) > sigaddset(&set, SIGALRM); > sigaddset(&set, SIG_IPI); > sigaddset(&set, SIGBUS); > - pthread_sigmask(SIG_BLOCK, &set, NULL); > #else > sigemptyset(&set); > sigaddset(&set, SIGBUS); > @@ -412,6 +411,7 @@ static int qemu_signal_init(void) > sigaddset(&set, SIGALRM); > } > #endif > + pthread_sigmask(SIG_BLOCK, &set, NULL); > > sigfd = qemu_signalfd(&set); > if (sigfd == -1) { Acked-by: Jan Kiszka Thanks, Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux