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/2] support of cpupools in xl: update cpumask ha

To: Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [Patch 1/2] support of cpupools in xl: update cpumask handling for cpu pools in libxc and python
From: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
Date: Wed, 6 Oct 2010 14:17:14 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 06 Oct 2010 06:18:15 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4CAB2D0E.5070907@xxxxxxxxxxxxxx>
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>
Organization: Citrix Systems, Inc.
References: <4CA58BB2.60709@xxxxxxxxxxxxxx> <1285925748.16095.46858.camel@xxxxxxxxxxxxxxxxxxxxxx> <4CAB2D0E.5070907@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Tue, 2010-10-05 at 14:50 +0100, Juergen Gross wrote:
> >
> > This will leak the previous value of ptr if realloc() fails. You need to
> > do:
> >       tmp = realloc(ptr, ....)
> >       if (!tmp) {
> >               free(ptr);
> >               LIBXL__LOG_ERRNO(...);
> >               return NULL;
> >       }
> >       ptr = tmp;
> >
> >
> 
> Should be changed in other places, too:
> libxc/xc_tmem.c
> libxl/libxl.c (sometimes not even checked for error)

Undoubtedly, but lets not make things worse ;-)

I've added this to my todo list...

> >> diff -r 71f836615ea2 tools/python/xen/lowlevel/xc/xc.c
> >> --- a/tools/python/xen/lowlevel/xc/xc.c Fri Sep 24 15:54:39 2010 +0100
> >> +++ b/tools/python/xen/lowlevel/xc/xc.c Fri Oct 01 09:03:17 2010 +0200
> >> @@ -241,7 +241,7 @@ static PyObject *pyxc_vcpu_setaffinity(X
> >>       if ( xc_physinfo(self->xc_handle,&info) != 0 )
> >>           return pyxc_error_to_exception(self->xc_handle);
> >>
> >> -    nr_cpus = info.nr_cpus;
> >> +    nr_cpus = info.max_cpu_id + 1;
> >>
> >>       size = (nr_cpus + cpumap_size * 8 - 1)/ (cpumap_size * 8);
> >>       cpumap = malloc(cpumap_size * size);
> >
> > Is this (and the equivalent in getinfo) an independent bug fix for a
> > pre-existing issue or does it somehow relate to the rest of the changes?
> > I don't see any corresponding change to xc_vcpu_setaffinity is all.
> 
> It's an independent fix. OTOH it's cpumask related, so I put it in...
> xc_vcpu_setaffinity is not touched as it takes the cpumask size as
> parameter.

Please separate unrelated fixes into their own patches. Not least
because it allows you to accurately changelog them.

Thanks,
Ian.


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