From patchwork Wed Mar 30 21:03:38 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 846 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:46:24 -0000 Delivered-To: patches@linaro.org Received: by 10.42.161.68 with SMTP id s4cs77064icx; Wed, 30 Mar 2011 14:03:49 -0700 (PDT) Received: by 10.227.140.77 with SMTP id h13mr1777647wbu.217.1301519028115; Wed, 30 Mar 2011 14:03:48 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk [81.2.115.146]) by mx.google.com with ESMTPS id bc3si1104329wbb.64.2011.03.30.14.03.47 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 30 Mar 2011 14:03:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1Q52YE-0006wl-1G; Wed, 30 Mar 2011 22:03:38 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: Gleb Natapov , patches@linaro.org Subject: [PATCH] vl.c: Tidy up message printed when we exit on a signal Date: Wed, 30 Mar 2011 22:03:38 +0100 Message-Id: <1301519018-26680-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 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 Reviewed-by: Stefan Hajnoczi Acked-by: Gleb Natapov --- 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; } }