From 5853ea85dca267331446c9ac59d4d9bff501472a Mon Sep 17 00:00:00 2001 From: Chen Hanxiao Date: Mon, 19 Sep 2016 16:17:57 +0800 Subject: [PATCH] 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 --- src/qemu/qemu_process.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 1f56883e4f..6937dada57 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -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); } -- 2.47.2