From ea12318767e45d96d929827068ee410eaf09e711 Mon Sep 17 00:00:00 2001 From: Dario Faggioli Date: Fri, 6 Jul 2012 13:17:42 +0100 Subject: libxl: rename libxl_cpumap to libxl_bitmap 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. While at it, add the usual initialization function, common to all libxl data structures. Signed-off-by: Dario Faggioli Acked-by: Ian Campbell Committed-by: Ian Campbell --- tools/libxl/libxl_json.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tools/libxl/libxl_json.c') diff --git a/tools/libxl/libxl_json.c b/tools/libxl/libxl_json.c index cd2719ab1e..e870606db5 100644 --- a/tools/libxl/libxl_json.c +++ b/tools/libxl/libxl_json.c @@ -99,8 +99,8 @@ yajl_gen_status libxl_uuid_gen_json(yajl_gen hand, 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 *bitmap) { yajl_gen_status s; int i; @@ -108,8 +108,8 @@ yajl_gen_status libxl_cpumap_gen_json(yajl_gen hand, 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, *bitmap) { + if (libxl_bitmap_test(bitmap, i)) { s = yajl_gen_integer(hand, i); if (s != yajl_gen_status_ok) goto out; } -- cgit v1.2.3