qemu_process: show shutoff reasons when debug log disabled

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>
This commit is contained in:
Chen Hanxiao 2016-09-19 16:17:57 +08:00 committed by John Ferlan
parent 0467ab3ff4
commit 5853ea85dc

View 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);
}