aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl_utils.h
diff options
context:
space:
mode:
authorJuergen Gross <juergen.gross@ts.fujitsu.com>2010-11-03 12:10:46 +0000
committerJuergen Gross <juergen.gross@ts.fujitsu.com>2010-11-03 12:10:46 +0000
commit9180abe5683a107588014dc57058e756c0047bb6 (patch)
tree0f7c7c633da4a3b381175c2381af12dbde9134ea /tools/libxl/libxl_utils.h
parent02bac862c003b2da5bb5c396e3ca19a7fb6990ea (diff)
downloadxen-9180abe5683a107588014dc57058e756c0047bb6.tar.gz
xen-9180abe5683a107588014dc57058e756c0047bb6.tar.bz2
xen-9180abe5683a107588014dc57058e756c0047bb6.zip
tools: change cpumaps to uint8_t
Cpumap types in tools (libxc and libxl) are changed to be based on bytes like in the interface to the hypervisor. To make handling easier the size of used cpumaps is always based on the number of physical cpus supported by the hypervisor. This eliminates the need to keep track of the cpumap size in external interfaces. In libxl a macro for cycling through a cpumap is added (libxl_for_each_cpu). Interfaces changed: libxl_set_vcpuaffinity() libxl_cpumap_alloc() xc_vcpu_setaffinity() xc_vcpu_getaffinity() xc_cpupool_freeinfo() Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools/libxl/libxl_utils.h')
-rw-r--r--tools/libxl/libxl_utils.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/libxl/libxl_utils.h b/tools/libxl/libxl_utils.h
index 1c7a0407b8..7846c4233c 100644
--- a/tools/libxl/libxl_utils.h
+++ b/tools/libxl/libxl_utils.h
@@ -76,9 +76,11 @@ int libxl_devid_to_device_net2(libxl_ctx *ctx, uint32_t domid,
* return -1 if there are an error */
int libxl_check_device_model_version(libxl_ctx *ctx, char *path);
-int libxl_cpumap_alloc(libxl_cpumap *cpumap, int max_cpus);
+int libxl_cpumap_alloc(libxl_ctx *ctx, libxl_cpumap *cpumap);
int libxl_cpumap_test(libxl_cpumap *cpumap, int cpu);
void libxl_cpumap_set(libxl_cpumap *cpumap, int cpu);
void libxl_cpumap_reset(libxl_cpumap *cpumap, int cpu);
+#define libxl_for_each_cpu(var, map) for (var = 0; var < (map).size * 8; var++)
+
#endif