]> xenbits.xensource.com Git - xen.git/commitdiff
libxl: add sched_get_id function
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 22 Apr 2010 08:38:39 +0000 (09:38 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 22 Apr 2010 08:38:39 +0000 (09:38 +0100)
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@amd.com>
Acked-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
tools/libxl/libxl.c
tools/libxl/libxl.h

index 1ef4325e7d76abbe7c546adfe8f6a167295c7d89..3db4249a34d31778acc571ed5d823fecefbc88a1 100644 (file)
@@ -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;
+}
index 8b9d869426fade6e6c1fe076335ea1d2b09d7169..b07961311202198e3b0d9979c382e84e1616dfa5 100644 (file)
@@ -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 */