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: Count CPUs rather than relying on a

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend: Count CPUs rather than relying on a static
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 10 Jul 2007 04:32:02 -0700
Delivery-date: Tue, 10 Jul 2007 04:30:13 -0700
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 1184058796 -3600
# Node ID 3f2d2adc87f708e269247e5e89eef3c2c595d83b
# Parent  b476c756ad4fdc41b0246fb4c943997e740e256e
xend: Count CPUs rather than relying on a static
nodes/sockets/cores/threads relationship.
Signed-off-by: Alex Williamson <alex.williamson@xxxxxx>
---
 tools/python/xen/xend/XendNode.py |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff -r b476c756ad4f -r 3f2d2adc87f7 tools/python/xen/xend/XendNode.py
--- a/tools/python/xen/xend/XendNode.py Tue Jul 10 10:11:14 2007 +0100
+++ b/tools/python/xen/xend/XendNode.py Tue Jul 10 10:13:16 2007 +0100
@@ -580,14 +580,17 @@ class XendNode:
             str='none\n'
         return str[:-1];
 
+    def count_cpus(self, pinfo):
+        count=0
+        node_to_cpu=pinfo['node_to_cpu']
+        for i in range(0, pinfo['nr_nodes']):
+            count+=len(node_to_cpu[i])
+        return count;
 
     def physinfo(self):
         info = self.xc.physinfo()
 
-        info['nr_cpus'] = (info['nr_nodes'] *
-                           info['sockets_per_node'] *
-                           info['cores_per_socket'] *
-                           info['threads_per_core'])
+        info['nr_cpus'] = self.count_cpus(info)
         info['cpu_mhz'] = info['cpu_khz'] / 1000
         
         # physinfo is in KiB, need it in MiB

_______________________________________________
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: Count CPUs rather than relying on a static, Xen patchbot-unstable <=