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: 88978 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4D6CCB6F12 for ; Thu, 31 Mar 2011 08:04:29 +1100 (EST) Received: from localhost ([127.0.0.1]:37036 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q52Yz-00079p-VC for incoming@patchwork.ozlabs.org; Wed, 30 Mar 2011 17:04:25 -0400 Received: from [140.186.70.92] (port=57419 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q52YO-000797-VS for qemu-devel@nongnu.org; Wed, 30 Mar 2011 17:03:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q52YN-0002pH-Rj for qemu-devel@nongnu.org; Wed, 30 Mar 2011 17:03:48 -0400 Received: from mnementh.archaic.org.uk ([81.2.115.146]:56702) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q52YN-0002p2-Ko for qemu-devel@nongnu.org; Wed, 30 Mar 2011 17:03:47 -0400 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 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 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 81.2.115.146 Cc: Gleb Natapov , patches@linaro.org Subject: [Qemu-devel] [PATCH] vl.c: Tidy up message printed when we exit on a signal X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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; } }