thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-qemu-progress-Fix-progress-printing-on-SIGUSR1.patch

0a122b
From a06249cc31c0f8c2ae37c7e0ff047a922a265e7c Mon Sep 17 00:00:00 2001
0a122b
From: Kevin Wolf <kwolf@redhat.com>
0a122b
Date: Tue, 11 Feb 2014 16:24:43 +0100
0a122b
Subject: [PATCH 26/28] qemu-progress: Fix progress printing on SIGUSR1
0a122b
0a122b
RH-Author: Kevin Wolf <kwolf@redhat.com>
0a122b
Message-id: <1392135884-10508-3-git-send-email-kwolf@redhat.com>
0a122b
Patchwork-id: 57223
0a122b
O-Subject: [RHEL-7.0 qemu-kvm PATCH 2/3] qemu-progress: Fix progress printing on SIGUSR1
0a122b
Bugzilla: 997878
0a122b
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
0a122b
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>
0a122b
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
0a122b
0a122b
Since commit a7aae221 ('Switch SIG_IPI to SIGUSR1'), SIGUSR1 is blocked
0a122b
during startup, breaking the progress report in tools.
0a122b
0a122b
This patch reenables the signal when initialising a progress report.
0a122b
0a122b
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
0a122b
Reviewed-by: Benoit Canet <benoit@irqsave.net>
0a122b
(cherry picked from commit 3c4b4e383e82ab3db307ee01f12ab0d4a28584dc)
0a122b
0a122b
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
0a122b
---
0a122b
 util/qemu-progress.c | 10 ++++++++++
0a122b
 1 file changed, 10 insertions(+)
0a122b
0a122b
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
0a122b
---
0a122b
 util/qemu-progress.c |   10 ++++++++++
0a122b
 1 files changed, 10 insertions(+), 0 deletions(-)
0a122b
0a122b
diff --git a/util/qemu-progress.c b/util/qemu-progress.c
0a122b
index ad33fee..4ee5cd0 100644
0a122b
--- a/util/qemu-progress.c
0a122b
+++ b/util/qemu-progress.c
0a122b
@@ -82,12 +82,22 @@ static void progress_dummy_init(void)
0a122b
 {
0a122b
 #ifdef CONFIG_POSIX
0a122b
     struct sigaction action;
0a122b
+    sigset_t set;
0a122b
 
0a122b
     memset(&action, 0, sizeof(action));
0a122b
     sigfillset(&action.sa_mask);
0a122b
     action.sa_handler = sigusr_print;
0a122b
     action.sa_flags = 0;
0a122b
     sigaction(SIGUSR1, &action, NULL);
0a122b
+
0a122b
+    /*
0a122b
+     * SIGUSR1 is SIG_IPI and gets blocked in qemu_init_main_loop(). In the
0a122b
+     * tools that use the progress report SIGUSR1 isn't used in this meaning
0a122b
+     * and instead should print the progress, so reenable it.
0a122b
+     */
0a122b
+    sigemptyset(&set);
0a122b
+    sigaddset(&set, SIGUSR1);
0a122b
+    pthread_sigmask(SIG_UNBLOCK, &set, NULL);
0a122b
 #endif
0a122b
 
0a122b
     state.print = progress_dummy_print;
0a122b
-- 
0a122b
1.7.1
0a122b