Patchwork [01/11] ignore SIGPIPE in qemu-img and qemu-io

login
register
mail settings
Submitter MORITA Kazutaka
Date July 23, 2013, 8:30 a.m.
Message ID <1374568221-23147-2-git-send-email-morita.kazutaka@lab.ntt.co.jp>
Download mbox | patch
Permalink /patch/260985/
State New
Headers show

Comments

MORITA Kazutaka - July 23, 2013, 8:30 a.m.
This prevents the tools from being stopped when they write data to a
closed connection in the other side.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
---
 qemu-img.c | 4 ++++
 qemu-io.c  | 4 ++++
 2 files changed, 8 insertions(+)
Paolo Bonzini - July 23, 2013, 9:19 a.m.
Il 23/07/2013 10:30, MORITA Kazutaka ha scritto:
> This prevents the tools from being stopped when they write data to a
> closed connection in the other side.
> 
> Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
> ---
>  qemu-img.c | 4 ++++
>  qemu-io.c  | 4 ++++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/qemu-img.c b/qemu-img.c
> index c55ca5c..919d464 100644
> --- a/qemu-img.c
> +++ b/qemu-img.c
> @@ -2319,6 +2319,10 @@ int main(int argc, char **argv)
>      const img_cmd_t *cmd;
>      const char *cmdname;
>  
> +#ifdef CONFIG_POSIX
> +    signal(SIGPIPE, SIG_IGN);
> +#endif
> +
>      error_set_progname(argv[0]);
>  
>      qemu_init_main_loop();
> diff --git a/qemu-io.c b/qemu-io.c
> index cb9def5..d54dc86 100644
> --- a/qemu-io.c
> +++ b/qemu-io.c
> @@ -335,6 +335,10 @@ int main(int argc, char **argv)
>      int opt_index = 0;
>      int flags = BDRV_O_UNMAP;
>  
> +#ifdef CONFIG_POSIX
> +    signal(SIGPIPE, SIG_IGN);
> +#endif
> +
>      progname = basename(argv[0]);
>  
>      while ((c = getopt_long(argc, argv, sopt, lopt, &opt_index)) != -1) {
> 

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

and adding qemu-stable for this one.
Doug Goldstein - Aug. 3, 2013, 3:52 a.m.
On Tue, Jul 23, 2013 at 4:19 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> Il 23/07/2013 10:30, MORITA Kazutaka ha scritto:
>> This prevents the tools from being stopped when they write data to a
>> closed connection in the other side.
>>
>> Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
>> ---
>>  qemu-img.c | 4 ++++
>>  qemu-io.c  | 4 ++++
>>  2 files changed, 8 insertions(+)
>>
>> diff --git a/qemu-img.c b/qemu-img.c
>> index c55ca5c..919d464 100644
>> --- a/qemu-img.c
>> +++ b/qemu-img.c
>> @@ -2319,6 +2319,10 @@ int main(int argc, char **argv)
>>      const img_cmd_t *cmd;
>>      const char *cmdname;
>>
>> +#ifdef CONFIG_POSIX
>> +    signal(SIGPIPE, SIG_IGN);
>> +#endif
>> +
>>      error_set_progname(argv[0]);
>>
>>      qemu_init_main_loop();
>> diff --git a/qemu-io.c b/qemu-io.c
>> index cb9def5..d54dc86 100644
>> --- a/qemu-io.c
>> +++ b/qemu-io.c
>> @@ -335,6 +335,10 @@ int main(int argc, char **argv)
>>      int opt_index = 0;
>>      int flags = BDRV_O_UNMAP;
>>
>> +#ifdef CONFIG_POSIX
>> +    signal(SIGPIPE, SIG_IGN);
>> +#endif
>> +
>>      progname = basename(argv[0]);
>>
>>      while ((c = getopt_long(argc, argv, sopt, lopt, &opt_index)) != -1) {
>>
>
> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
>
> and adding qemu-stable for this one.
>

Nudge so this isn't forgotten about since it hasn't hit master yet.
Kevin Wolf - Aug. 5, 2013, 11:57 a.m.
Am 03.08.2013 um 05:52 hat Doug Goldstein geschrieben:
> On Tue, Jul 23, 2013 at 4:19 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> > Il 23/07/2013 10:30, MORITA Kazutaka ha scritto:
> >> This prevents the tools from being stopped when they write data to a
> >> closed connection in the other side.
> >>
> >> Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
> >> ---
> >>  qemu-img.c | 4 ++++
> >>  qemu-io.c  | 4 ++++
> >>  2 files changed, 8 insertions(+)
> >>
> >> diff --git a/qemu-img.c b/qemu-img.c
> >> index c55ca5c..919d464 100644
> >> --- a/qemu-img.c
> >> +++ b/qemu-img.c
> >> @@ -2319,6 +2319,10 @@ int main(int argc, char **argv)
> >>      const img_cmd_t *cmd;
> >>      const char *cmdname;
> >>
> >> +#ifdef CONFIG_POSIX
> >> +    signal(SIGPIPE, SIG_IGN);
> >> +#endif
> >> +
> >>      error_set_progname(argv[0]);
> >>
> >>      qemu_init_main_loop();
> >> diff --git a/qemu-io.c b/qemu-io.c
> >> index cb9def5..d54dc86 100644
> >> --- a/qemu-io.c
> >> +++ b/qemu-io.c
> >> @@ -335,6 +335,10 @@ int main(int argc, char **argv)
> >>      int opt_index = 0;
> >>      int flags = BDRV_O_UNMAP;
> >>
> >> +#ifdef CONFIG_POSIX
> >> +    signal(SIGPIPE, SIG_IGN);
> >> +#endif
> >> +
> >>      progname = basename(argv[0]);
> >>
> >>      while ((c = getopt_long(argc, argv, sopt, lopt, &opt_index)) != -1) {
> >>
> >
> > Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
> >
> > and adding qemu-stable for this one.
> >
> 
> Nudge so this isn't forgotten about since it hasn't hit master yet.

Thanks, applied to the block branch.

Kevin

Patch

diff --git a/qemu-img.c b/qemu-img.c
index c55ca5c..919d464 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -2319,6 +2319,10 @@  int main(int argc, char **argv)
     const img_cmd_t *cmd;
     const char *cmdname;
 
+#ifdef CONFIG_POSIX
+    signal(SIGPIPE, SIG_IGN);
+#endif
+
     error_set_progname(argv[0]);
 
     qemu_init_main_loop();
diff --git a/qemu-io.c b/qemu-io.c
index cb9def5..d54dc86 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -335,6 +335,10 @@  int main(int argc, char **argv)
     int opt_index = 0;
     int flags = BDRV_O_UNMAP;
 
+#ifdef CONFIG_POSIX
+    signal(SIGPIPE, SIG_IGN);
+#endif
+
     progname = basename(argv[0]);
 
     while ((c = getopt_long(argc, argv, sopt, lopt, &opt_index)) != -1) {