From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49121) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWMkm-0002aM-7K for qemu-devel@nongnu.org; Tue, 14 Jun 2011 02:05:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QWMkk-0005Dr-RE for qemu-devel@nongnu.org; Tue, 14 Jun 2011 02:05:32 -0400 Received: from fmmailgate01.web.de ([217.72.192.221]:55215) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWMkk-0005Dl-FO for qemu-devel@nongnu.org; Tue, 14 Jun 2011 02:05:30 -0400 Message-ID: <4DF6FA27.3090206@web.de> Date: Tue, 14 Jun 2011 08:05:27 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <1308023191-7157-1-git-send-email-cerbere@gmail.com> In-Reply-To: <1308023191-7157-1-git-send-email-cerbere@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigE7D27A80E2F558EDFB95AFD0" Sender: jan.kiszka@web.de Subject: Re: [Qemu-devel] [PATCH] 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 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigE7D27A80E2F558EDFB95AFD0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable On 2011-06-14 05:46, Alexandre Raymond wrote: > This fix effectively blocks, in the main thread, the signals handled > by signalfd or the compatibility signal thread. >=20 > This way, such signals are received synchronously in the main thread > through sigfd_handler() instead of triggering the signal handler > directly, asynchronously. >=20 > Signed-off-by: Alexandre Raymond > --- > cpus.c | 1 + > 1 files changed, 1 insertions(+), 0 deletions(-) >=20 > 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 > =20 > sigfd =3D qemu_signalfd(&set); Good catch. Probably remained unnoticed as most of us have signalfd support on their boxes so that the window for async delivery was rather small. But please pull the now common pthread_sigmask out of the #ifdef. Jan --------------enigE7D27A80E2F558EDFB95AFD0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAk32+icACgkQitSsb3rl5xTzpACgpDEQaAImrtRCS/SB8Qu9yqC8 1KsAnA5LlQGJJMNCbbX6+Eg2U621i+nX =62Jj -----END PGP SIGNATURE----- --------------enigE7D27A80E2F558EDFB95AFD0--