summaryrefslogtreecommitdiff
path: root/vl.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2011-03-30 22:03:38 +0100
committerAurelien Jarno <aurelien@aurel32.net>2011-04-04 00:24:50 +0200
commitf1d3fb04d55f46d39073e7089a5be43a16e80aa9 (patch)
tree8e4f200bdbeeff3efd45ca894767691997d22d91 /vl.c
parent22156ab498acf5f8104801148732ae8e83f336a0 (diff)
downloadqemu-f1d3fb04d55f46d39073e7089a5be43a16e80aa9.zip
vl.c: Tidy up message printed when we exit on a signal
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> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Acked-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'vl.c')
-rw-r--r--vl.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/vl.c b/vl.c
index d3d81e08fb..5c80600c71 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;
}
}