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: Use max_node_id rather than nr_node

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xend: Use max_node_id rather than nr_nodes where appropriate.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 18 Jan 2010 02:50:27 -0800
Delivery-date: Mon, 18 Jan 2010 02:51:07 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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 Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1263752404 0
# Node ID 7a8cee80597eb374409fe2f320e740ef9ef051ce
# Parent  757359a367856bb79b26119292be013a23234c16
xend: Use max_node_id rather than nr_nodes where appropriate.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 tools/python/xen/xend/XendDomainInfo.py |   10 +++++-----
 tools/python/xen/xend/XendNode.py       |    7 ++++---
 2 files changed, 9 insertions(+), 8 deletions(-)

diff -r 757359a36785 -r 7a8cee80597e tools/python/xen/xend/XendDomainInfo.py
--- a/tools/python/xen/xend/XendDomainInfo.py   Sun Jan 17 18:07:10 2010 +0000
+++ b/tools/python/xen/xend/XendDomainInfo.py   Sun Jan 17 18:20:04 2010 +0000
@@ -2690,7 +2690,7 @@ class XendDomainInfo:
         else:
             def find_relaxed_node(node_list):
                 import sys
-                nr_nodes = info['nr_nodes']
+                nr_nodes = info['max_node_id']+1
                 if node_list is None:
                     node_list = range(0, nr_nodes)
                 nodeload = [0]
@@ -2722,12 +2722,12 @@ class XendDomainInfo:
                 node_memory_list = info['node_to_memory']
                 needmem = 
self.image.getRequiredAvailableMemory(self.info['memory_dynamic_max']) / 1024
                 candidate_node_list = []
-                for i in range(0, info['nr_nodes']):
+                for i in range(0, info['max_node_id']+1):
                     if node_memory_list[i] >= needmem and 
len(info['node_to_cpu'][i]) > 0:
                         candidate_node_list.append(i)
                 best_node = find_relaxed_node(candidate_node_list)[0]
                 cpumask = info['node_to_cpu'][best_node]
-                best_nodes = find_relaxed_node(filter(lambda x: x != 
best_node, range(0,info['nr_nodes'])))
+                best_nodes = find_relaxed_node(filter(lambda x: x != 
best_node, range(0,info['max_node_id']+1)))
                 for node_idx in best_nodes:
                     if len(cpumask) >= self.info['VCPUs_max']:
                         break
@@ -2754,9 +2754,9 @@ class XendDomainInfo:
             while (retries > 0):
                 physinfo = xc.physinfo()
                 free_mem = physinfo['free_memory']
-                nr_nodes = physinfo['nr_nodes']
+                max_node_id = physinfo['max_node_id']
                 node_to_dma32_mem = physinfo['node_to_dma32_mem']
-                if (node > nr_nodes):
+                if (node > max_node_id):
                     return
                 # Extra 2MB above 64GB seems to do the trick.
                 need_mem = 64 * 1024 + 2048 - node_to_dma32_mem[node]
diff -r 757359a36785 -r 7a8cee80597e tools/python/xen/xend/XendNode.py
--- a/tools/python/xen/xend/XendNode.py Sun Jan 17 18:07:10 2010 +0000
+++ b/tools/python/xen/xend/XendNode.py Sun Jan 17 18:20:04 2010 +0000
@@ -879,7 +879,7 @@ class XendNode:
         whitespace=''
         try:
             node_to_cpu=pinfo['node_to_cpu']
-            for i in range(0, pinfo['nr_nodes']):
+            for i in range(0, pinfo['max_node_id']+1):
                 str+='%snode%d:%s\n' % (whitespace,
                                         i, 
                                       self.list_to_strrange(node_to_cpu[i]))
@@ -892,7 +892,7 @@ class XendNode:
         whitespace=''
         try:
             node_to_memory=pinfo[key]
-            for i in range(0, pinfo['nr_nodes']):
+            for i in range(0, pinfo['max_node_id']+1):
                 str+='%snode%d:%d\n' % (whitespace,
                                         i,
                                         node_to_memory[i] / 1024)
@@ -927,7 +927,8 @@ class XendNode:
                       'free_memory',
                       'node_to_cpu',
                       'node_to_memory',
-                      'node_to_dma32_mem'
+                      'node_to_dma32_mem',
+                      'max_node_id'
                       ]
 
         return [[k, info[k]] for k in ITEM_ORDER]

_______________________________________________
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: Use max_node_id rather than nr_nodes where appropriate., Xen patchbot-unstable <=