[PATCH] Bug fix: Allow sysinfo to display processor information

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Prerna Saxena <prerna@xxxxxxxxxxxxxxxxxx>
Date: Mon, 6 Feb 2012 13:46:10 +0530
Subject: [PATCH] Bugfix: Allow sysinfo to display 'processor' information

Calls to virSysinfoParseBIOS(), virSysinfoParseSystem() would update
the buffer pointer 'base', so the processor information would be lost
before virSysinfoParseProcessor() was called. Sysinfo would therefore
not be able to display processor details -- It only described <bios>,
<system> and <memory_device> details.

Before the fix:
---------------
virsh # sysinfo
<sysinfo type='smbios'>
  <bios>
    ....
  </bios>
  <system>
    ....
  </system>
  <memory_device>
    ....
  </memory_device>

After the fix:
-------------
virsh # sysinfo
<sysinfo type='smbios'>
  <bios>
    ....
  </bios>
  <system>
    ....
  </system>
  <processor>
    ....
  </processor>
  <memory_device>
    ....
  </memory_device>
---
 src/util/sysinfo.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/util/sysinfo.c b/src/util/sysinfo.c
index de3108a..d92d655 100644
--- a/src/util/sysinfo.c
+++ b/src/util/sysinfo.c
@@ -483,16 +483,17 @@ virSysinfoRead(void) {
 
     base = outbuf;
 
+    ret->nprocessor = 0;
+    ret->processor = NULL;
+    if ((base = virSysinfoParseProcessor(base, ret)) == NULL)
+        goto no_memory;
+
     if ((base = virSysinfoParseBIOS(base, ret)) == NULL)
         goto no_memory;
 
     if ((base = virSysinfoParseSystem(base, ret)) == NULL)
         goto no_memory;
 
-    ret->nprocessor = 0;
-    ret->processor = NULL;
-    if ((base = virSysinfoParseProcessor(base, ret)) == NULL)
-        goto no_memory;
 
     ret->nmemory = 0;
     ret->memory = NULL;
-- 
1.7.3.1



-- 
Prerna Saxena

Linux Technology Centre,
IBM Systems and Technology Lab,
Bangalore, India

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]