]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Read the host sysinfo for the QEmu driver
authorDaniel Veillard <veillard@redhat.com>
Fri, 29 Oct 2010 12:18:29 +0000 (14:18 +0200)
committerDaniel Veillard <veillard@redhat.com>
Mon, 8 Nov 2010 14:14:50 +0000 (15:14 +0100)
Read and store the data when initializing the driver.

src/qemu/qemu_conf.h
src/qemu/qemu_driver.c

index bbe68871c4166fb581606d8f319c4bd6810a488c..13ddbb24e2936c92e62e01ab16b4c80a5d691bc7 100644 (file)
@@ -169,6 +169,8 @@ struct qemud_driver {
     pciDeviceList *activePciHostdevs;
 
     virBitmapPtr reservedVNCPorts;
+
+    virSysinfoDefPtr hostsysinfo;
 };
 
 typedef struct _qemuDomainPCIAddressSet qemuDomainPCIAddressSet;
index 2a84e5d8ca2f35cfff1d8edfb725991798e0b7f5..e7b37e10fb2625e2b4e8ee59571624b433ff65a1 100644 (file)
@@ -77,6 +77,7 @@
 #include "xml.h"
 #include "cpu/cpu.h"
 #include "macvtap.h"
+#include "sysinfo.h"
 #include "domain_nwfilter.h"
 #include "hooks.h"
 #include "storage_file.h"
@@ -1753,6 +1754,10 @@ qemudStartup(int privileged) {
          virBitmapAlloc(QEMU_VNC_PORT_MAX - QEMU_VNC_PORT_MIN)) == NULL)
         goto out_of_memory;
 
+    /* read the host sysinfo */
+    if (privileged)
+        qemu_driver->hostsysinfo = virSysinfoRead();
+
     if (privileged) {
         if (virAsprintf(&qemu_driver->logDir,
                         "%s/log/libvirt/qemu", LOCAL_STATE_DIR) == -1)
@@ -2059,6 +2064,8 @@ qemudShutdown(void) {
     virDomainObjListDeinit(&qemu_driver->domains);
     virBitmapFree(qemu_driver->reservedVNCPorts);
 
+    virSysinfoDefFree(qemu_driver->hostsysinfo);
+
     VIR_FREE(qemu_driver->securityDriverName);
     VIR_FREE(qemu_driver->logDir);
     VIR_FREE(qemu_driver->configDir);