From: Chen Hanxiao Date: Mon, 19 Sep 2016 08:17:57 +0000 (+0800) Subject: qemu_process: show shutoff reasons when debug log disabled X-Git-Tag: v2.3.0-rc1~88 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5853ea85dca267331446c9ac59d4d9bff501472a;p=thirdparty%2Flibvirt.git 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 --- 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); }