]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu_process: show shutoff reasons when debug log disabled
authorChen Hanxiao <chenhanxiao@gmail.com>
Mon, 19 Sep 2016 08:17:57 +0000 (16:17 +0800)
committerJohn Ferlan <jferlan@redhat.com>
Wed, 21 Sep 2016 21:03:24 +0000 (17:03 -0400)
We have a few of senarios that libvirtd would invoke qemuProcessStop
and leave a "shutting down" in /var/log/libvirt/qemu/$DOMAIN.log.

The shutoff reason showing in debug log is also very important
for us to know why VM shutting down in domain log,
as we seldom enable debug log of libvirtd.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
src/qemu/qemu_process.c

index 1f56883e4fd994549069e61479efb4eceb0b3aaa..6937dada5753a36a5fe4399a6c209833ef88c44f 100644 (file)
@@ -5810,7 +5810,9 @@ void qemuProcessStop(virQEMUDriverPtr driver,
     virDomainObjBroadcast(vm);
 
     if ((timestamp = virTimeStringNow()) != NULL) {
-        qemuDomainLogAppendMessage(driver, vm, "%s: shutting down\n", timestamp);
+        qemuDomainLogAppendMessage(driver, vm, "%s: shutting down, reason=%s\n",
+                                   timestamp,
+                                   virDomainShutoffReasonTypeToString(reason));
         VIR_FREE(timestamp);
     }