From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47622) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5FfR-0005Vq-87 for qemu-devel@nongnu.org; Mon, 20 Jan 2014 09:17:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W5FfL-0005Uf-4M for qemu-devel@nongnu.org; Mon, 20 Jan 2014 09:17:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:28208) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W5FfK-0005T4-Sv for qemu-devel@nongnu.org; Mon, 20 Jan 2014 09:17:27 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s0KEHQ4Q032210 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 20 Jan 2014 09:17:26 -0500 From: Kevin Wolf Date: Mon, 20 Jan 2014 15:17:20 +0100 Message-Id: <1390227441-28854-3-git-send-email-kwolf@redhat.com> In-Reply-To: <1390227441-28854-1-git-send-email-kwolf@redhat.com> References: <1390227441-28854-1-git-send-email-kwolf@redhat.com> Subject: [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: qemu-devel@nongnu.org Cc: kwolf@redhat.com, stefanha@redhat.com Since commit a7aae221 ('Switch SIG_IPI to SIGUSR1'), SIGUSR1 is blocked during startup, breaking the progress report in tools. This patch reenables the signal when initialising a progress report. Signed-off-by: Kevin Wolf --- util/qemu-progress.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; memset(&action, 0, sizeof(action)); sigfillset(&action.sa_mask); action.sa_handler = sigusr_print; action.sa_flags = 0; sigaction(SIGUSR1, &action, NULL); + + /* + * SIGUSR1 is SIG_IPI and gets blocked in qemu_init_main_loop(). In the + * tools that use the progress report SIGUSR1 isn't used in this meaning + * and instead should print the progress, so reenable it. + */ + sigemptyset(&set); + sigaddset(&set, SIGUSR1); + pthread_sigmask(SIG_UNBLOCK, &set, NULL); #endif state.print = progress_dummy_print; -- 1.8.1.4