qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] vl.c: Tidy up message printed when we exit on a signal
@ 2011-03-30 21:03 Peter Maydell
  2011-03-31  6:19 ` Stefan Hajnoczi
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Peter Maydell @ 2011-03-30 21:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gleb Natapov, patches

Tidy up the message printed when qemu exits due to a signal, so that
it's clearer where the message is coming from and that it's not just
stray debug output.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 vl.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/vl.c b/vl.c
index 5c9205f..4d9e503 100644
--- a/vl.c
+++ b/vl.c
@@ -1169,8 +1169,15 @@ int qemu_shutdown_requested(void)
 void qemu_kill_report(void)
 {
     if (shutdown_signal != -1) {
-        fprintf(stderr, "Got signal %d from pid %d\n",
-                         shutdown_signal, shutdown_pid);
+        fprintf(stderr, "qemu: terminating on signal %d", shutdown_signal);
+        if (shutdown_pid == 0) {
+            /* This happens for eg ^C at the terminal, so it's worth
+             * avoiding printing an odd message in that case.
+             */
+            fputc('\n', stderr);
+        } else {
+            fprintf(stderr, " from pid %d\n", shutdown_pid);
+        }
         shutdown_signal = -1;
     }
 }
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] vl.c: Tidy up message printed when we exit on a signal
  2011-03-30 21:03 [Qemu-devel] [PATCH] vl.c: Tidy up message printed when we exit on a signal Peter Maydell
@ 2011-03-31  6:19 ` Stefan Hajnoczi
  2011-03-31  8:37 ` [Qemu-devel] " Gleb Natapov
  2011-04-03 22:25 ` [Qemu-devel] " Aurelien Jarno
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2011-03-31  6:19 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel, Gleb Natapov, patches

On Wed, Mar 30, 2011 at 10:03 PM, Peter Maydell
<peter.maydell@linaro.org> wrote:
> Tidy up the message printed when qemu exits due to a signal, so that
> it's clearer where the message is coming from and that it's not just
> stray debug output.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  vl.c |   11 +++++++++--
>  1 files changed, 9 insertions(+), 2 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] Re: [PATCH] vl.c: Tidy up message printed when we exit on a signal
  2011-03-30 21:03 [Qemu-devel] [PATCH] vl.c: Tidy up message printed when we exit on a signal Peter Maydell
  2011-03-31  6:19 ` Stefan Hajnoczi
@ 2011-03-31  8:37 ` Gleb Natapov
  2011-04-03 22:25 ` [Qemu-devel] " Aurelien Jarno
  2 siblings, 0 replies; 4+ messages in thread
From: Gleb Natapov @ 2011-03-31  8:37 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel, patches

On Wed, Mar 30, 2011 at 10:03:38PM +0100, Peter Maydell wrote:
> Tidy up the message printed when qemu exits due to a signal, so that
> it's clearer where the message is coming from and that it's not just
> stray debug output.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Gleb Natapov <gleb@redhat.com>

> ---
>  vl.c |   11 +++++++++--
>  1 files changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/vl.c b/vl.c
> index 5c9205f..4d9e503 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -1169,8 +1169,15 @@ int qemu_shutdown_requested(void)
>  void qemu_kill_report(void)
>  {
>      if (shutdown_signal != -1) {
> -        fprintf(stderr, "Got signal %d from pid %d\n",
> -                         shutdown_signal, shutdown_pid);
> +        fprintf(stderr, "qemu: terminating on signal %d", shutdown_signal);
> +        if (shutdown_pid == 0) {
> +            /* This happens for eg ^C at the terminal, so it's worth
> +             * avoiding printing an odd message in that case.
> +             */
> +            fputc('\n', stderr);
> +        } else {
> +            fprintf(stderr, " from pid %d\n", shutdown_pid);
> +        }
>          shutdown_signal = -1;
>      }
>  }
> -- 
> 1.7.1

--
			Gleb.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] vl.c: Tidy up message printed when we exit on a signal
  2011-03-30 21:03 [Qemu-devel] [PATCH] vl.c: Tidy up message printed when we exit on a signal Peter Maydell
  2011-03-31  6:19 ` Stefan Hajnoczi
  2011-03-31  8:37 ` [Qemu-devel] " Gleb Natapov
@ 2011-04-03 22:25 ` Aurelien Jarno
  2 siblings, 0 replies; 4+ messages in thread
From: Aurelien Jarno @ 2011-04-03 22:25 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel, Gleb Natapov, patches

On Wed, Mar 30, 2011 at 10:03:38PM +0100, Peter Maydell wrote:
> Tidy up the message printed when qemu exits due to a signal, so that
> it's clearer where the message is coming from and that it's not just
> stray debug output.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  vl.c |   11 +++++++++--
>  1 files changed, 9 insertions(+), 2 deletions(-)

Thanks, applied.

> diff --git a/vl.c b/vl.c
> index 5c9205f..4d9e503 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -1169,8 +1169,15 @@ int qemu_shutdown_requested(void)
>  void qemu_kill_report(void)
>  {
>      if (shutdown_signal != -1) {
> -        fprintf(stderr, "Got signal %d from pid %d\n",
> -                         shutdown_signal, shutdown_pid);
> +        fprintf(stderr, "qemu: terminating on signal %d", shutdown_signal);
> +        if (shutdown_pid == 0) {
> +            /* This happens for eg ^C at the terminal, so it's worth
> +             * avoiding printing an odd message in that case.
> +             */
> +            fputc('\n', stderr);
> +        } else {
> +            fprintf(stderr, " from pid %d\n", shutdown_pid);
> +        }
>          shutdown_signal = -1;
>      }
>  }
> -- 
> 1.7.1
> 
> 
> 

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-04-03 22:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-30 21:03 [Qemu-devel] [PATCH] vl.c: Tidy up message printed when we exit on a signal Peter Maydell
2011-03-31  6:19 ` Stefan Hajnoczi
2011-03-31  8:37 ` [Qemu-devel] " Gleb Natapov
2011-04-03 22:25 ` [Qemu-devel] " Aurelien Jarno

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).