[libvirt] [PATCH v3 2/2] x86: Allow sysinfo to fall back on /proc/cpuinfo if demidecode is absent.

Daniel Veillard veillard at redhat.com
Fri Mar 23 13:55:01 UTC 2012


On Thu, Mar 15, 2012 at 04:17:20PM +0530, Prerna wrote:
> From: Prerna Saxena <prerna at linux.vnet.ibm.com>
> Date: Thu, 16 Feb 2012 15:33:43 +0530
> Subject: [PATCH 2/2] Sysinfo : Allow x86 to fetch sysinfo from /proc/cpuinfo
>  in the event 'dmidecode' is absent in the system.
> 
> Until now, libvirt on x86 flags an error message if dmidecode is not
> found. With this patch, the following is a sample output on x86 when
> dmidecode is absent:
[...]
> +        if(!physical_id) {
> +            physical_id = tmp_physical_id;
> +        }
> +        else if (!strncmp(physical_id, tmp_physical_id, physical_id_len)) {
> +            base = cur;
> +            continue;
> +        }

  BTW this strncmp shold be replace by the following patch,

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel at veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/
-------------- next part --------------
diff --git a/src/util/sysinfo.c b/src/util/sysinfo.c
index 220338f..e6d687e 100644
--- a/src/util/sysinfo.c
+++ b/src/util/sysinfo.c
@@ -620,7 +620,7 @@ virSysinfoParseCPUInfoProcessor(const char *base, virSysinfoDefPtr ret)
         if(!physical_id) {
             physical_id = tmp_physical_id;
         }
-        else if (!strncmp(physical_id, tmp_physical_id, physical_id_len)) {
+        else if (STREQLEN(physical_id, tmp_physical_id, physical_id_len)) {
             base = cur;
             continue;
         }


More information about the libvir-list mailing list