[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-3.2-testing] xm: Fix xm vcpu-pin to complain for CPU numbers out of range.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1203606799 0
# Node ID 7259ff0d563fbce1bfa850b8ccd709599f61b0ed
# Parent  f2704afb68504c54df3b865512bcd3cae283fce6
xm: Fix xm vcpu-pin to complain for CPU numbers out of range.
Signed-off-by: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
xen-unstable changeset:   17092:511ab2b89ced1e190c6c76139b60049b69be69ef
xen-unstable date:        Wed Feb 20 17:42:12 2008 +0000
---
 tools/python/xen/lowlevel/xc/xc.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletion(-)

diff -r f2704afb6850 -r 7259ff0d563f tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c Mon Feb 18 21:29:31 2008 +0000
+++ b/tools/python/xen/lowlevel/xc/xc.c Thu Feb 21 15:13:19 2008 +0000
@@ -226,7 +226,16 @@ static PyObject *pyxc_vcpu_setaffinity(X
     {
         cpumap = 0ULL;
         for ( i = 0; i < PyList_Size(cpulist); i++ ) 
-            cpumap |= (uint64_t)1 << PyInt_AsLong(PyList_GetItem(cpulist, i));
+        {
+            long cpu = PyInt_AsLong(PyList_GetItem(cpulist, i));
+            if ( cpu >= 64 )
+            {
+                errno = EINVAL;
+                PyErr_SetFromErrno(xc_error_obj);
+                return NULL;
+            }
+            cpumap |= (uint64_t)1 << cpu;
+        }
     }
   
     if ( xc_vcpu_setaffinity(self->xc_handle, dom, vcpu, cpumap) != 0 )

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.