WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] xend: more flexibility in gathering data

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend: more flexibility in gathering data from /proc/cpuinfo
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 07 Mar 2007 11:31:08 -0800
Delivery-date: Wed, 07 Mar 2007 13:00:00 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1173182017 0
# Node ID ae203b55e7c833b8ed934fab8e06d00e694ae989
# Parent  c8843678cb9bac670366f68d07668b0d037b624d
xend: more flexibility in gathering data from /proc/cpuinfo

Add ia64 mapping for cpuinfo data and make the case where #vcpu !=
#pcpu more flexible (don't rely on cpu0 existing).

Signed-off-by: Alex Williamson <alex.williamson@xxxxxx>
---
 tools/python/xen/xend/XendNode.py |   41 ++++++++++++++++++++++++++------------
 1 files changed, 29 insertions(+), 12 deletions(-)

diff -r c8843678cb9b -r ae203b55e7c8 tools/python/xen/xend/XendNode.py
--- a/tools/python/xen/xend/XendNode.py Mon Mar 05 16:22:21 2007 -0600
+++ b/tools/python/xen/xend/XendNode.py Tue Mar 06 11:53:37 2007 +0000
@@ -22,7 +22,7 @@ import xen.lowlevel.xc
 
 from xen.util import Brctl
 
-from xen.xend import uuid
+from xen.xend import uuid, arch
 from xen.xend.XendError import *
 from xen.xend.XendOptions import instance as xendoptions
 from xen.xend.XendQCoWStorageRepo import XendQCoWStorageRepo
@@ -98,20 +98,37 @@ class XendNode:
             log.error(self.cpus[u])
             number = self.cpus[u]['number']
             # We can run off the end of the cpuinfo list if domain0 does not
-            # have #vcpus == #pcpus. In that case we just replicate pcpu0 info.
+            # have #vcpus == #pcpus. In that case we just replicate one that's
+            # in the hash table.
             if not cpuinfo.has_key(number):
-                number = 0
+                number = cpuinfo.keys()[0]
             log.error(number)
             log.error(cpuinfo)
-            self.cpus[u].update(
-                { 'host'     : self.uuid,
-                  'features' : cpu_features,
-                  'speed'    : int(float(cpuinfo[number]['cpu MHz'])),
-                  'vendor'   : cpuinfo[number]['vendor_id'],
-                  'modelname': cpuinfo[number]['model name'],
-                  'stepping' : cpuinfo[number]['stepping'],
-                  'flags'    : cpuinfo[number]['flags'],
-                })
+            if arch.type == "x86":
+                self.cpus[u].update(
+                    { 'host'     : self.uuid,
+                      'features' : cpu_features,
+                      'speed'    : int(float(cpuinfo[number]['cpu MHz'])),
+                      'vendor'   : cpuinfo[number]['vendor_id'],
+                      'modelname': cpuinfo[number]['model name'],
+                      'stepping' : cpuinfo[number]['stepping'],
+                      'flags'    : cpuinfo[number]['flags'],
+                    })
+            elif arch.type == "ia64":
+                self.cpus[u].update(
+                    { 'host'     : self.uuid,
+                      'features' : cpu_features,
+                      'speed'    : int(float(cpuinfo[number]['cpu MHz'])),
+                      'vendor'   : cpuinfo[number]['vendor'],
+                      'modelname': cpuinfo[number]['family'],
+                      'stepping' : cpuinfo[number]['model'],
+                      'flags'    : cpuinfo[number]['features'],
+                    })
+            else:
+                self.cpus[u].update(
+                    { 'host'     : self.uuid,
+                      'features' : cpu_features,
+                    })
 
         self.pifs = {}
         self.pif_metrics = {}

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xend: more flexibility in gathering data from /proc/cpuinfo, Xen patchbot-unstable <=