]> Git Repo - qemu.git/commitdiff
qemu_kill_report: Report PID name too
authorMichal Privoznik <[email protected]>
Tue, 27 Sep 2016 15:24:57 +0000 (17:24 +0200)
committerPaolo Bonzini <[email protected]>
Tue, 4 Oct 2016 08:00:27 +0000 (10:00 +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 <[email protected]>
Message-Id: <a2ba85a8e349a0ea9ee06424226197a03cd04bd3.1474987617[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
vl.c

diff --git a/vl.c b/vl.c
index f3abd99eb2f9b2e7153d06f911d20b5d21cca61b..6c5a51c49c9c7a05f0f5a143c681d192986e4509 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -1675,8 +1675,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;
     }
This page took 0.031101 seconds and 4 git commands to generate.