[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCHv2 2/4] 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 <andre.przywara@xxxxxxx>
---
 tools/libxl/libxl.c |   13 +++++++++++++
 tools/libxl/libxl.h |    2 ++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 1ef4325..3db4249 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 8b9d869..b079613 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 */
 
-- 
1.6.4



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.