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

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



On Thu, Mar 15, 2012 at 04:17:20PM +0530, Prerna wrote:
> From: Prerna Saxena <prerna 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 veillard com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/
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;
         }

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