qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, patches@linaro.org
Subject: [Qemu-devel] Re: [PATCH] vl.c: Tidy up message printed when we exit on a signal
Date: Thu, 31 Mar 2011 10:37:13 +0200	[thread overview]
Message-ID: <20110331083713.GH7766@redhat.com> (raw)
In-Reply-To: <1301519018-26680-1-git-send-email-peter.maydell@linaro.org>

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.

  parent reply	other threads:[~2011-03-31  8:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2011-04-03 22:25 ` Aurelien Jarno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110331083713.GH7766@redhat.com \
    --to=gleb@redhat.com \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).