[xen master] python: xc: fix max_cpu_index sign error

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen master] python: xc: fix max_cpu_index sign error

patchbot
commit 3bc9c4f98a5dea5afda3ad2aae243e88d12a7e09
Author:     Petre Eftime <[hidden email]>
AuthorDate: Thu Apr 5 12:49:23 2018 +0000
Commit:     Wei Liu <[hidden email]>
CommitDate: Fri Apr 6 09:05:28 2018 +0100

    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 <[hidden email]>
    Acked-by: Marek Marczykowski-Górecki <[hidden email]>
    Release-acked-by: Juergen Gross <[hidden email]>
---
 tools/python/xen/lowlevel/xc/xc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index f501764100..694bfa0642 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -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);
--
generated by git-patchbot for /home/xen/git/xen.git#master


_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog