|
[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 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.
>
> 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.
> {
> yajl_gen_status s;
> int i;
> @@ -108,8 +108,8 @@ yajl_gen_status libxl_cpumap_gen_json(ya
> s = yajl_gen_array_open(hand);
> if (s != yajl_gen_status_ok) goto out;
>
> - libxl_for_each_cpu(i, *cpumap) {
> - if (libxl_cpumap_test(cpumap, i)) {
> + libxl_for_each_bit(i, *cpumap) {
> + if (libxl_bitmap_test(cpumap, i)) {
> s = yajl_gen_integer(hand, i);
> if (s != yajl_gen_status_ok) goto out;
> }
Even with that minor nit:
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |