From bb57a6a6bc91a4e5c622644213eb628a510f508c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Fri, 18 May 2018 12:17:38 +0100 Subject: [PATCH] qemu: include kernel version in QEMU log file MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit We currently print the libvirt and qemu version strings into the per-guest logfile. It would be useful to know what kernel is running too, so add that. Reviewed-by: Kashyap Chamarthy Tested-by: Kashyap Chamarthy Signed-off-by: Daniel P. Berrangé --- src/qemu/qemu_process.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 5b73a61962..174d932ae7 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -32,6 +32,8 @@ # include #endif +#include + #include "qemu_process.h" #include "qemu_processpriv.h" #include "qemu_alias.h" @@ -4283,17 +4285,21 @@ qemuLogOperation(virDomainObjPtr vm, int qemuVersion = virQEMUCapsGetVersion(priv->qemuCaps); const char *package = virQEMUCapsGetPackage(priv->qemuCaps); char *hostname = virGetHostname(); + struct utsname uts; + + uname(&uts); if ((timestamp = virTimeStringNow()) == NULL) goto cleanup; if (qemuDomainLogContextWrite(logCtxt, - "%s: %s %s, qemu version: %d.%d.%d%s, hostname: %s\n", + "%s: %s %s, qemu version: %d.%d.%d%s, kernel: %s, hostname: %s\n", timestamp, msg, VIR_LOG_VERSION_STRING, (qemuVersion / 1000000) % 1000, (qemuVersion / 1000) % 1000, qemuVersion % 1000, package ? package : "", + uts.release, hostname ? hostname : "") < 0) goto cleanup; -- 2.39.5