From: Keir Fraser Date: Thu, 22 Apr 2010 08:38:39 +0000 (+0100) Subject: libxl: add sched_get_id function X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~12323 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=419794de6896184846b0f2dce5f53f7128b7ea68;p=xen.git libxl: add sched_get_id function To get the name of the currently used scheduler, Xen provides a sched_id sysctl. Add a libxl wrapper around the libxc function to query this. Signed-off-by: Andre Przywara Acked-by: Vincent Hanquez --- diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 1ef4325e7d..3db4249a34 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -2421,3 +2421,16 @@ int libxl_set_vcpucount(struct libxl_ctx *ctx, uint32_t domid, uint32_t count) } return 0; } + +/* + * returns one of the XEN_SCHEDULER_* constants from public/domctl.h + * or -1 if an error occured. + */ +int libxl_get_sched_id(struct libxl_ctx *ctx) +{ + int sched, ret; + + if ((ret = xc_sched_id(ctx->xch, &sched)) != 0) + return ret; + return sched; +} diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h index 8b9d869426..b079613112 100644 --- a/tools/libxl/libxl.h +++ b/tools/libxl/libxl.h @@ -438,5 +438,7 @@ struct libxl_vcpuinfo *libxl_list_vcpu(struct libxl_ctx *ctx, uint32_t domid, int libxl_set_vcpuaffinity(struct libxl_ctx *ctx, uint32_t domid, uint32_t vcpuid, uint64_t *cpumap, int cpusize); int libxl_set_vcpucount(struct libxl_ctx *ctx, uint32_t domid, uint32_t count); + +int libxl_get_sched_id(struct libxl_ctx *ctx); #endif /* LIBXL_H */