WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 1 of 4] Support getting topology info in libxl

To: Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 1 of 4] Support getting topology info in libxl
From: Gianni Tedesco <gianni.tedesco@xxxxxxxxxx>
Date: Thu, 9 Dec 2010 12:09:53 +0000
Cc: Ian, Campbell <Ian.Campbell@xxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Delivery-date: Thu, 09 Dec 2010 04:10:50 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <37fdfe90e0c26bfac22e.1290755424@xxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <37fdfe90e0c26bfac22e.1290755424@xxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>