[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 1 of 4] Support getting topology info in libxl
On Fri, 2010-11-26 at 07:10 +0000, Juergen Gross wrote: > diff -r 79b71c77907b -r 37fdfe90e0c2 tools/python/xen/lowlevel/xl/xl.c > --- a/tools/python/xen/lowlevel/xl/xl.c Wed Nov 24 10:20:03 2010 +0000 > +++ b/tools/python/xen/lowlevel/xl/xl.c Thu Nov 25 09:29:43 2010 +0100 > @@ -224,6 +224,11 @@ > return 0; > } > > +int attrib__libxl_cpuarray_set(PyObject *v, libxl_cpuarray *pptr) > +{ > + return -1; > +} > + > int attrib__libxl_domain_build_state_ptr_set(PyObject *v, > libxl_domain_build_state **pptr) > { > return -1; > @@ -284,6 +289,25 @@ > } > } > return cpulist; > +} > + > +PyObject *attrib__libxl_cpuarray_get(libxl_cpuarray *pptr) > +{ > + PyObject *list = NULL; > + int i; > + > + list = PyList_New(0); > + for (i = 0; i < pptr->entries; i++) { > + if (pptr->array[i] == LIBXL_CPUARRAY_INVENTRY) { > + PyList_Append(list, Py_None); Needs a Py_INCREF(Py_None); - this is a confusing rule about python lists. There are actually a slew of these Py_None refcounting bugs in there that I have a patch for and will send out at some point. Thanks for the patch Gianni _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |