From 5ec8fb566206c49d6abe054bc39b72353ec9811d Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Mon, 7 Feb 2011 16:16:04 -0700 Subject: [PATCH] sysinfo: implement qemu support * src/qemu/qemu_driver.c (qemuGetSysinfo): New function. (qemuDriver): Install it. --- src/qemu/qemu_driver.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 87d228b558..52ea98e844 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -3275,6 +3275,22 @@ static int kvmGetMaxVCPUs(void) { } +static char * +qemuGetSysinfo(virConnectPtr conn, unsigned int flags) +{ + struct qemud_driver *driver = conn->privateData; + + virCheckFlags(0, NULL); + + if (!driver->hostsysinfo) { + qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("Host SMBIOS information is not available")); + return NULL; + } + + return virSysinfoFormat(driver->hostsysinfo, ""); +} + static int qemudGetMaxVCPUs(virConnectPtr conn ATTRIBUTE_UNUSED, const char *type) { if (!type) return 16; @@ -10375,7 +10391,7 @@ static virDriver qemuDriver = { qemudGetVersion, /* version */ NULL, /* libvirtVersion (impl. in libvirt.c) */ virGetHostname, /* getHostname */ - NULL, /* getSysinfo */ + qemuGetSysinfo, /* getSysinfo */ qemudGetMaxVCPUs, /* getMaxVcpus */ nodeGetInfo, /* nodeGetInfo */ qemudGetCapabilities, /* getCapabilities */ -- GitLab