提交 1e4c4599 编写于 作者: D Daniel Veillard

Read the host sysinfo for the QEmu driver

Read and store the data when initializing the driver.
上级 778c0976
...@@ -169,6 +169,8 @@ struct qemud_driver { ...@@ -169,6 +169,8 @@ struct qemud_driver {
pciDeviceList *activePciHostdevs; pciDeviceList *activePciHostdevs;
virBitmapPtr reservedVNCPorts; virBitmapPtr reservedVNCPorts;
virSysinfoDefPtr hostsysinfo;
}; };
typedef struct _qemuDomainPCIAddressSet qemuDomainPCIAddressSet; typedef struct _qemuDomainPCIAddressSet qemuDomainPCIAddressSet;
......
...@@ -77,6 +77,7 @@ ...@@ -77,6 +77,7 @@
#include "xml.h" #include "xml.h"
#include "cpu/cpu.h" #include "cpu/cpu.h"
#include "macvtap.h" #include "macvtap.h"
#include "sysinfo.h"
#include "domain_nwfilter.h" #include "domain_nwfilter.h"
#include "hooks.h" #include "hooks.h"
#include "storage_file.h" #include "storage_file.h"
...@@ -1753,6 +1754,10 @@ qemudStartup(int privileged) { ...@@ -1753,6 +1754,10 @@ qemudStartup(int privileged) {
virBitmapAlloc(QEMU_VNC_PORT_MAX - QEMU_VNC_PORT_MIN)) == NULL) virBitmapAlloc(QEMU_VNC_PORT_MAX - QEMU_VNC_PORT_MIN)) == NULL)
goto out_of_memory; goto out_of_memory;
/* read the host sysinfo */
if (privileged)
qemu_driver->hostsysinfo = virSysinfoRead();
if (privileged) { if (privileged) {
if (virAsprintf(&qemu_driver->logDir, if (virAsprintf(&qemu_driver->logDir,
"%s/log/libvirt/qemu", LOCAL_STATE_DIR) == -1) "%s/log/libvirt/qemu", LOCAL_STATE_DIR) == -1)
...@@ -2059,6 +2064,8 @@ qemudShutdown(void) { ...@@ -2059,6 +2064,8 @@ qemudShutdown(void) {
virDomainObjListDeinit(&qemu_driver->domains); virDomainObjListDeinit(&qemu_driver->domains);
virBitmapFree(qemu_driver->reservedVNCPorts); virBitmapFree(qemu_driver->reservedVNCPorts);
virSysinfoDefFree(qemu_driver->hostsysinfo);
VIR_FREE(qemu_driver->securityDriverName); VIR_FREE(qemu_driver->securityDriverName);
VIR_FREE(qemu_driver->logDir); VIR_FREE(qemu_driver->logDir);
VIR_FREE(qemu_driver->configDir); VIR_FREE(qemu_driver->configDir);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册