From a5d30c236a41e269313380bc584da9e7ddfa251d Mon Sep 17 00:00:00 2001 From: Dario Faggioli Date: Wed, 17 Apr 2013 10:57:34 +0000 Subject: libxl: allow for explicitly specifying node-affinity By introducing a nodemap in libxl_domain_build_info and providing the get/set methods to deal with it. Signed-off-by: Dario Faggioli Acked-by: Juergen Gross Acked-by: George Dunlap Acked-by: Ian Campbell --- tools/libxl/libxl.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tools/libxl/libxl.c') diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 03a9782de1..3c6d71b32e 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -4183,6 +4183,26 @@ int libxl_set_vcpuaffinity_all(libxl_ctx *ctx, uint32_t domid, return rc; } +int libxl_domain_set_nodeaffinity(libxl_ctx *ctx, uint32_t domid, + libxl_bitmap *nodemap) +{ + if (xc_domain_node_setaffinity(ctx->xch, domid, nodemap->map)) { + LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "setting node affinity"); + return ERROR_FAIL; + } + return 0; +} + +int libxl_domain_get_nodeaffinity(libxl_ctx *ctx, uint32_t domid, + libxl_bitmap *nodemap) +{ + if (xc_domain_node_getaffinity(ctx->xch, domid, nodemap->map)) { + LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting node affinity"); + return ERROR_FAIL; + } + return 0; +} + int libxl_set_vcpuonline(libxl_ctx *ctx, uint32_t domid, libxl_bitmap *cpumap) { GC_INIT(ctx); -- cgit v1.2.3