* [Qemu-devel] [PATCH 0/3] qemu-img: Fix progress printing on SIGUSR1
@ 2014-01-20 14:17 Kevin Wolf
2014-01-20 14:17 ` [Qemu-devel] [PATCH 1/3] qemu-progress: Drop unused include Kevin Wolf
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Kevin Wolf @ 2014-01-20 14:17 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, stefanha
Kevin Wolf (3):
qemu-progress: Drop unused include
qemu-progress: Fix progress printing on SIGUSR1
Documentation: qemu-img: Mention SIGUSR1 progress report
qemu-img.texi | 4 +++-
util/qemu-progress.c | 11 ++++++++++-
2 files changed, 13 insertions(+), 2 deletions(-)
--
1.8.1.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Qemu-devel] [PATCH 1/3] qemu-progress: Drop unused include
2014-01-20 14:17 [Qemu-devel] [PATCH 0/3] qemu-img: Fix progress printing on SIGUSR1 Kevin Wolf
@ 2014-01-20 14:17 ` Kevin Wolf
2014-01-21 14:30 ` Benoît Canet
2014-01-20 14:17 ` [Qemu-devel] [PATCH 2/3] qemu-progress: Fix progress printing on SIGUSR1 Kevin Wolf
2014-01-20 14:17 ` [Qemu-devel] [PATCH 3/3] Documentation: qemu-img: Mention SIGUSR1 progress report Kevin Wolf
2 siblings, 1 reply; 7+ messages in thread
From: Kevin Wolf @ 2014-01-20 14:17 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, stefanha
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
util/qemu-progress.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/util/qemu-progress.c b/util/qemu-progress.c
index 9a3f96c..ad33fee 100644
--- a/util/qemu-progress.c
+++ b/util/qemu-progress.c
@@ -24,7 +24,6 @@
#include "qemu-common.h"
#include "qemu/osdep.h"
-#include "sysemu/sysemu.h"
#include <stdio.h>
struct progress_state {
--
1.8.1.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Qemu-devel] [PATCH 2/3] qemu-progress: Fix progress printing on SIGUSR1
2014-01-20 14:17 [Qemu-devel] [PATCH 0/3] qemu-img: Fix progress printing on SIGUSR1 Kevin Wolf
2014-01-20 14:17 ` [Qemu-devel] [PATCH 1/3] qemu-progress: Drop unused include Kevin Wolf
@ 2014-01-20 14:17 ` Kevin Wolf
2014-01-21 14:33 ` Benoît Canet
2014-01-20 14:17 ` [Qemu-devel] [PATCH 3/3] Documentation: qemu-img: Mention SIGUSR1 progress report Kevin Wolf
2 siblings, 1 reply; 7+ messages in thread
From: Kevin Wolf @ 2014-01-20 14:17 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, stefanha
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>
---
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
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Qemu-devel] [PATCH 3/3] Documentation: qemu-img: Mention SIGUSR1 progress report
2014-01-20 14:17 [Qemu-devel] [PATCH 0/3] qemu-img: Fix progress printing on SIGUSR1 Kevin Wolf
2014-01-20 14:17 ` [Qemu-devel] [PATCH 1/3] qemu-progress: Drop unused include Kevin Wolf
2014-01-20 14:17 ` [Qemu-devel] [PATCH 2/3] qemu-progress: Fix progress printing on SIGUSR1 Kevin Wolf
@ 2014-01-20 14:17 ` Kevin Wolf
2014-01-21 14:36 ` Benoît Canet
2 siblings, 1 reply; 7+ messages in thread
From: Kevin Wolf @ 2014-01-20 14:17 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, stefanha
Document the SIGUSR1 behaviour of qemu-img. Also, added compare to the
list of subcommands that support -p.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
qemu-img.texi | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/qemu-img.texi b/qemu-img.texi
index 778e967..f86a86d 100644
--- a/qemu-img.texi
+++ b/qemu-img.texi
@@ -57,7 +57,9 @@ indicates that target image must be compressed (qcow format only)
@item -h
with or without a command shows help and lists the supported formats
@item -p
-display progress bar (convert and rebase commands only)
+display progress bar (compare, convert and rebase commands only).
+If the @var{-p} option is not used for a command that supports it, the
+progress is reported when the process receives a @code{SIGUSR1} signal.
@item -q
Quiet mode - do not print any output (except errors). There's no progress bar
in case both @var{-q} and @var{-p} options are used.
--
1.8.1.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH 1/3] qemu-progress: Drop unused include
2014-01-20 14:17 ` [Qemu-devel] [PATCH 1/3] qemu-progress: Drop unused include Kevin Wolf
@ 2014-01-21 14:30 ` Benoît Canet
0 siblings, 0 replies; 7+ messages in thread
From: Benoît Canet @ 2014-01-21 14:30 UTC (permalink / raw)
To: Kevin Wolf; +Cc: qemu-devel, stefanha
Le Monday 20 Jan 2014 à 15:17:19 (+0100), Kevin Wolf a écrit :
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> util/qemu-progress.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/util/qemu-progress.c b/util/qemu-progress.c
> index 9a3f96c..ad33fee 100644
> --- a/util/qemu-progress.c
> +++ b/util/qemu-progress.c
> @@ -24,7 +24,6 @@
>
> #include "qemu-common.h"
> #include "qemu/osdep.h"
> -#include "sysemu/sysemu.h"
> #include <stdio.h>
>
> struct progress_state {
> --
> 1.8.1.4
>
>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH 2/3] qemu-progress: Fix progress printing on SIGUSR1
2014-01-20 14:17 ` [Qemu-devel] [PATCH 2/3] qemu-progress: Fix progress printing on SIGUSR1 Kevin Wolf
@ 2014-01-21 14:33 ` Benoît Canet
0 siblings, 0 replies; 7+ messages in thread
From: Benoît Canet @ 2014-01-21 14:33 UTC (permalink / raw)
To: Kevin Wolf; +Cc: qemu-devel, stefanha
Le Monday 20 Jan 2014 à 15:17:20 (+0100), Kevin Wolf a écrit :
> 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>
> ---
> 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
>
>
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 <benoit@irqsave.net>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PATCH 3/3] Documentation: qemu-img: Mention SIGUSR1 progress report
2014-01-20 14:17 ` [Qemu-devel] [PATCH 3/3] Documentation: qemu-img: Mention SIGUSR1 progress report Kevin Wolf
@ 2014-01-21 14:36 ` Benoît Canet
0 siblings, 0 replies; 7+ messages in thread
From: Benoît Canet @ 2014-01-21 14:36 UTC (permalink / raw)
To: Kevin Wolf; +Cc: qemu-devel, stefanha
Le Monday 20 Jan 2014 à 15:17:21 (+0100), Kevin Wolf a écrit :
> Document the SIGUSR1 behaviour of qemu-img. Also, added compare to the
> list of subcommands that support -p.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> qemu-img.texi | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/qemu-img.texi b/qemu-img.texi
> index 778e967..f86a86d 100644
> --- a/qemu-img.texi
> +++ b/qemu-img.texi
> @@ -57,7 +57,9 @@ indicates that target image must be compressed (qcow format only)
> @item -h
> with or without a command shows help and lists the supported formats
> @item -p
> -display progress bar (convert and rebase commands only)
> +display progress bar (compare, convert and rebase commands only).
> +If the @var{-p} option is not used for a command that supports it, the
> +progress is reported when the process receives a @code{SIGUSR1} signal.
> @item -q
> Quiet mode - do not print any output (except errors). There's no progress bar
> in case both @var{-q} and @var{-p} options are used.
> --
> 1.8.1.4
>
>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-01-21 14:36 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-20 14:17 [Qemu-devel] [PATCH 0/3] qemu-img: Fix progress printing on SIGUSR1 Kevin Wolf
2014-01-20 14:17 ` [Qemu-devel] [PATCH 1/3] qemu-progress: Drop unused include Kevin Wolf
2014-01-21 14:30 ` Benoît Canet
2014-01-20 14:17 ` [Qemu-devel] [PATCH 2/3] qemu-progress: Fix progress printing on SIGUSR1 Kevin Wolf
2014-01-21 14:33 ` Benoît Canet
2014-01-20 14:17 ` [Qemu-devel] [PATCH 3/3] Documentation: qemu-img: Mention SIGUSR1 progress report Kevin Wolf
2014-01-21 14:36 ` Benoît Canet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).