diff -r db8a882f5515 tools/python/xen/lowlevel/xc/xc.c --- a/tools/python/xen/lowlevel/xc/xc.c Thu Jan 14 14:11:25 2010 +0000 +++ b/tools/python/xen/lowlevel/xc/xc.c Fri Jan 15 14:20:05 2010 +0100 @@ -1078,7 +1078,7 @@ #define MAX_CPU_ID 255 xc_physinfo_t info; char cpu_cap[128], virt_caps[128], *p; - int i, j, max_cpu_id, nr_nodes = 0; + int i, j, max_cpu_id; uint64_t free_heap; PyObject *ret_obj, *node_to_cpu_obj, *node_to_memory_obj; PyObject *node_to_dma32_mem_obj; @@ -1115,7 +1115,6 @@ node_to_dma32_mem_obj = PyList_New(0); for ( i = 0; i <= info.max_node_id; i++ ) { - int node_exists = 0; PyObject *pyint; /* CPUs. */ @@ -1127,14 +1126,12 @@ pyint = PyInt_FromLong(j); PyList_Append(cpus, pyint); Py_DECREF(pyint); - node_exists = 1; } PyList_Append(node_to_cpu_obj, cpus); Py_DECREF(cpus); /* Memory. */ xc_availheap(self->xc_handle, 0, 0, i, &free_heap); - node_exists = node_exists || (free_heap != 0); pyint = PyInt_FromLong(free_heap / 1024); PyList_Append(node_to_memory_obj, pyint); Py_DECREF(pyint); @@ -1145,13 +1142,10 @@ PyList_Append(node_to_dma32_mem_obj, pyint); Py_DECREF(pyint); - if ( node_exists ) - nr_nodes++; } - ret_obj = Py_BuildValue("{s:i,s:i,s:i,s:i,s:i,s:i,s:l,s:l,s:l,s:i,s:s:s:s}", - "nr_nodes", nr_nodes, - "max_node_id", info.max_node_id, + ret_obj = Py_BuildValue("{s:i,s:i,s:i,s:i,s:i,s:l,s:l,s:l,s:i,s:s,s:s}", + "nr_nodes", info.max_node_id + 1, "max_cpu_id", info.max_cpu_id, "threads_per_core", info.threads_per_core, "cores_per_socket", info.cores_per_socket,