From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andre Przywara Subject: [PATCH 2/4] libxl: add sched_get_id function Date: Sun, 18 Apr 2010 23:25:19 +0200 Message-ID: <4BCB78BF.8050502@amd.com> References: <4BCB76FD.1020103@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------060002090006070509090801" Return-path: In-Reply-To: <4BCB76FD.1020103@amd.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser , Stefano Stabellini , Ian.Jackson@eu.citrix.com Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org --------------060002090006070509090801 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit 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-Operating System Research Center (OSRC), Dresden, Germany Tel: +49 351 488-3567-12 --------------060002090006070509090801 Content-Type: text/plain; name="libxl_sched_id.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="libxl_sched_id.patch" diff -r 7ee8bb40200a tools/libxl/libxl.c --- a/tools/libxl/libxl.c Thu Apr 15 19:11:16 2010 +0100 +++ b/tools/libxl/libxl.c Sun Apr 18 14:37:44 2010 +0200 @@ -2421,3 +2421,13 @@ } return 0; } + +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 -r 7ee8bb40200a tools/libxl/libxl.h --- a/tools/libxl/libxl.h Thu Apr 15 19:11:16 2010 +0100 +++ b/tools/libxl/libxl.h Sun Apr 18 14:37:44 2010 +0200 @@ -441,5 +441,7 @@ 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 */ --------------060002090006070509090801 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------060002090006070509090801--