mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
python: xc: fix max_cpu_index sign error
When 0-indexing, maximum index is num_entries - 1. The python xc library had a sign error where the minus was replaced by a plus, making tools that depended on it to look for CPUs that did not exist. Signed-off-by: Petre Eftime <epetre@amazon.com> Acked-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> Release-acked-by: Juergen Gross <jgross@suse.com>
This commit is contained in:
1 parent
9ee6308d5b
commit
3bc9c4f98a
1 file changed
+1
-1
@@ -1079,7 +1079,7 @@ static PyObject *pyxc_topologyinfo(XcObject *self)
|
||||
}
|
||||
}
|
||||
|
||||
ret_obj = Py_BuildValue("{s:i}", "max_cpu_index", num_cpus + 1);
|
||||
ret_obj = Py_BuildValue("{s:i}", "max_cpu_index", num_cpus - 1);
|
||||
|
||||
PyDict_SetItemString(ret_obj, "cpu_to_core", cpu_to_core_obj);
|
||||
Py_DECREF(cpu_to_core_obj);
|
||||
|
||||