Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > ebe084c140192657f9094e135a84202c > files > 52

libvirt-0.8.2-29.el5.src.rpm

From 4e278bec6f41b4398f16e1e40a3eb77798076583 Mon Sep 17 00:00:00 2001
Message-Id: <4e278bec6f41b4398f16e1e40a3eb77798076583.1305127059.git.jdenemar@redhat.com>
From: Daniel Veillard <veillard@redhat.com>
Date: Mon, 9 May 2011 17:22:14 -0600
Subject: [PATCH] Read the host sysinfo for the QEmu driver

https://bugzilla.redhat.com/show_bug.cgi?id=661365

Read and store the data when initializing the driver.
(cherry picked from commit 1e4c45999e8c9f9013f39adb419dd9160e30bccc)
---
 src/qemu/qemu_conf.h   |    2 ++
 src/qemu/qemu_driver.c |    7 +++++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h
index 92cb63d..67c4e46 100644
--- a/src/qemu/qemu_conf.h
+++ b/src/qemu/qemu_conf.h
@@ -163,6 +163,8 @@ struct qemud_driver {
     pciDeviceList *activePciHostdevs;
 
     virBitmapPtr reservedVNCPorts;
+
+    virSysinfoDefPtr hostsysinfo;
 };
 
 typedef struct _qemuDomainPCIAddressSet qemuDomainPCIAddressSet;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index da6c1fe..3fa532b 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -74,6 +74,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"
@@ -1554,6 +1555,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)
@@ -1852,6 +1857,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);
-- 
1.7.5.rc3