From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46552) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5cO4-00052r-Hu for qemu-devel@nongnu.org; Tue, 21 Jan 2014 09:33:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W5cNz-0004a7-GI for qemu-devel@nongnu.org; Tue, 21 Jan 2014 09:33:08 -0500 Received: from paradis.irqsave.net ([62.212.105.220]:47970) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5cNz-0004a1-6y for qemu-devel@nongnu.org; Tue, 21 Jan 2014 09:33:03 -0500 Date: Tue, 21 Jan 2014 15:33:03 +0100 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140121143302.GK9834@irqsave.net> References: <1390227441-28854-1-git-send-email-kwolf@redhat.com> <1390227441-28854-3-git-send-email-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1390227441-28854-3-git-send-email-kwolf@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 2/3] qemu-progress: Fix progress printing on SIGUSR1 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, stefanha@redhat.com Le Monday 20 Jan 2014 =E0 15:17:20 (+0100), Kevin Wolf a =E9crit : > Since commit a7aae221 ('Switch SIG_IPI to SIGUSR1'), SIGUSR1 is blocked > during startup, breaking the progress report in tools. >=20 > This patch reenables the signal when initialising a progress report. >=20 > Signed-off-by: Kevin Wolf > --- > util/qemu-progress.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) >=20 > diff --git a/util/qemu-progress.c b/util/qemu-progress.c > index ad33fee..4ee5cd0 100644 > --- a/util/qemu-progress.c > +++ b/util/qemu-progress.c > @@ -82,12 +82,22 @@ static void progress_dummy_init(void) > { > #ifdef CONFIG_POSIX > struct sigaction action; > + sigset_t set; > =20 > memset(&action, 0, sizeof(action)); > sigfillset(&action.sa_mask); > action.sa_handler =3D sigusr_print; > action.sa_flags =3D 0; > sigaction(SIGUSR1, &action, NULL); > + > + /* > + * SIGUSR1 is SIG_IPI and gets blocked in qemu_init_main_loop(). I= n the > + * tools that use the progress report SIGUSR1 isn't used in this m= eaning > + * and instead should print the progress, so reenable it. > + */ > + sigemptyset(&set); > + sigaddset(&set, SIGUSR1); > + pthread_sigmask(SIG_UNBLOCK, &set, NULL); > #endif > =20 > state.print =3D progress_dummy_print; > --=20 > 1.8.1.4 >=20 >=20 I wonder if it worth it to restore the signal blocking state in progress_dummy_end to avoid future side effects. Reviewed-by: Benoit Canet