[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 2/2] qemu_kill_report: Report PID name too
From: |
Michal Privoznik |
Subject: |
[Qemu-devel] [PATCH v4 2/2] qemu_kill_report: Report PID name too |
Date: |
Tue, 27 Sep 2016 17:24:57 +0200 |
When qemu is being killed, its last words are:
2016-08-31T11:48:15.293587Z qemu-system-x86_64: terminating on signal 15 from
pid 11180
That's nice, but what process is 11180? What if I told you we can
do better:
2016-08-31T11:48:15.293587Z qemu-system-x86_64: terminating on signal 15 from
pid 11180 (/usr/sbin/libvirtd)
And that's exactly what this patch does.
Signed-off-by: Michal Privoznik <address@hidden>
---
vl.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/vl.c b/vl.c
index 215a6f9..62a100e 100644
--- a/vl.c
+++ b/vl.c
@@ -1674,8 +1674,12 @@ static void qemu_kill_report(void)
*/
error_report("terminating on signal %d", shutdown_signal);
} else {
- error_report("terminating on signal %d from pid " FMT_pid,
- shutdown_signal, shutdown_pid);
+ char *shutdown_cmd = qemu_get_pid_name(shutdown_pid);
+
+ error_report("terminating on signal %d from pid " FMT_pid " (%s)",
+ shutdown_signal, shutdown_pid,
+ shutdown_cmd ? shutdown_cmd : "<unknown process>");
+ g_free(shutdown_cmd);
}
shutdown_signal = -1;
}
--
2.8.4