qemu: include kernel version in QEMU log file
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 <kchamart@redhat.com> Tested-by: Kashyap Chamarthy <kchamart@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
b6dddb5408
commit
bb57a6a6bc
@ -32,6 +32,8 @@
|
|||||||
# include <sys/cpuset.h>
|
# include <sys/cpuset.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <sys/utsname.h>
|
||||||
|
|
||||||
#include "qemu_process.h"
|
#include "qemu_process.h"
|
||||||
#include "qemu_processpriv.h"
|
#include "qemu_processpriv.h"
|
||||||
#include "qemu_alias.h"
|
#include "qemu_alias.h"
|
||||||
@ -4283,17 +4285,21 @@ qemuLogOperation(virDomainObjPtr vm,
|
|||||||
int qemuVersion = virQEMUCapsGetVersion(priv->qemuCaps);
|
int qemuVersion = virQEMUCapsGetVersion(priv->qemuCaps);
|
||||||
const char *package = virQEMUCapsGetPackage(priv->qemuCaps);
|
const char *package = virQEMUCapsGetPackage(priv->qemuCaps);
|
||||||
char *hostname = virGetHostname();
|
char *hostname = virGetHostname();
|
||||||
|
struct utsname uts;
|
||||||
|
|
||||||
|
uname(&uts);
|
||||||
|
|
||||||
if ((timestamp = virTimeStringNow()) == NULL)
|
if ((timestamp = virTimeStringNow()) == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (qemuDomainLogContextWrite(logCtxt,
|
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,
|
timestamp, msg, VIR_LOG_VERSION_STRING,
|
||||||
(qemuVersion / 1000000) % 1000,
|
(qemuVersion / 1000000) % 1000,
|
||||||
(qemuVersion / 1000) % 1000,
|
(qemuVersion / 1000) % 1000,
|
||||||
qemuVersion % 1000,
|
qemuVersion % 1000,
|
||||||
package ? package : "",
|
package ? package : "",
|
||||||
|
uts.release,
|
||||||
hostname ? hostname : "") < 0)
|
hostname ? hostname : "") < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user