aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2014-01-20 15:06:03 +0100
committerKevin Wolf <kwolf@redhat.com>2014-01-24 14:33:00 +0100
commit3c4b4e383e82ab3db307ee01f12ab0d4a28584dc (patch)
tree914fa53dea26d0c596866e324bec4368793a746c
parente69968d472bd020a08c677c814237548090d2e59 (diff)
qemu-progress: Fix progress printing on SIGUSR1
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 <kwolf@redhat.com> Reviewed-by: Benoit Canet <benoit@irqsave.net>
-rw-r--r--util/qemu-progress.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/util/qemu-progress.c b/util/qemu-progress.c
index ad33fee98d..4ee5cd07f2 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;