From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:34020) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWKb1-0007vL-C6 for qemu-devel@nongnu.org; Mon, 13 Jun 2011 23:47:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QWKb0-0000Yy-1D for qemu-devel@nongnu.org; Mon, 13 Jun 2011 23:47:19 -0400 Received: from mail-vx0-f173.google.com ([209.85.220.173]:64149) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWKaz-0000Yr-MK for qemu-devel@nongnu.org; Mon, 13 Jun 2011 23:47:17 -0400 Received: by vxb37 with SMTP id 37so4751198vxb.4 for ; Mon, 13 Jun 2011 20:47:16 -0700 (PDT) From: Alexandre Raymond Date: Mon, 13 Jun 2011 23:46:31 -0400 Message-Id: <1308023191-7157-1-git-send-email-cerbere@gmail.com> Subject: [Qemu-devel] [PATCH] Fix signal handling when io-thread is disabled List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alexandre Raymond , pbonzini@redhat.com, andreas.faerber@web.de, agraf@suse.de, jan.kiszka@siemens.com 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 | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/cpus.c b/cpus.c index 4ab76f0..b6366b5 100644 --- a/cpus.c +++ b/cpus.c @@ -411,6 +411,7 @@ static int qemu_signal_init(void) sigaddset(&set, SIGIO); sigaddset(&set, SIGALRM); } + pthread_sigmask(SIG_BLOCK, &set, NULL); #endif sigfd = qemu_signalfd(&set); -- 1.7.5