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

Re: [Xen-devel] [PATCH 05 of 10 v2] libxl: rename libxl_cpumap to libxl_bitmap



On Thu, 2012-06-21 at 10:12 +0100, Ian Campbell wrote:
> On Fri, 2012-06-15 at 18:04 +0100, Dario Faggioli wrote:
> > And leave to the caller the burden of knowing and remembering what kind
> > of bitmap each instance of libxl_bitmap is.
> > 
> > This is basically just some s/libxl_cpumap/libxl_bitmap/ (and some other
> > related interface name substitution, e.g., libxl_for_each_cpu) in a bunch
> > of files, with no real functional change involved.
> > 
> > A specific allocation helper is introduced, besides libxl_bitmap_alloc().
> > It is called libxl_cpu_bitmap_alloc() and is meant at substituting the old
> > libxl_cpumap_alloc(). It is just something easier to use in cases where one
> > wants to allocate a libxl_bitmap that is going to serve as a cpu map.
> > 
> > This is because we want to be able to deal with both cpu and NUMA node
> > maps, but we don't want to duplicate all the various helpers and wrappers.
> 
> FWIW I'd have been perfectly happy with a bunch of 
>       #define for_each_cpu(mumble) for_each_bit(mumble)
> type stuff, but I think Ian J and yourself didn't like those which I'm
> also fine with.
> 
Well, I'm fine with both approaches, actually. However, I've been asked
by Ian during last round to kill the duplication as much as I can, and
here it is what I came out with. :-)

That being said, if it's just a matter of adding back a couple of
libxl_for_each_{set_}cpu as a define to libxl_for_each_{set_} bit, I
could well do that, as it looks a "reasonable" amount of wrapper
duplication to me...

> > Signed-off-by: Dario Faggioli <dario.faggioli@xxxxxxxxxxxxx>
> > diff --git a/tools/libxl/libxl_json.c b/tools/libxl/libxl_json.c
> > --- a/tools/libxl/libxl_json.c
> > +++ b/tools/libxl/libxl_json.c
> > @@ -99,8 +99,8 @@ yajl_gen_status libxl_uuid_gen_json(yajl
> >      return yajl_gen_string(hand, (const unsigned char *)buf, 
> > LIBXL_UUID_FMTLEN);
> >  }
> > 
> > -yajl_gen_status libxl_cpumap_gen_json(yajl_gen hand,
> > -                                      libxl_cpumap *cpumap)
> > +yajl_gen_status libxl_bitmap_gen_json(yajl_gen hand,
> > +                                      libxl_bitmap *cpumap)
> 
> Minor nit: You likely meant to rename cpumap in the argument list too.
> 
In this case, I sure did, thanks for pointing it out.

> Even with that minor nit:
> 
> Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
> 
Good!

I'll fix the nit, as I have to resubmit anyway. :-P

Thanks and Regards,
Dario

-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://retis.sssup.it/people/faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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