From 337d298b0a071e55a0d934b9d8861828a35de4e8 Mon Sep 17 00:00:00 2001 From: Chester Lin Date: Sun, 24 Jan 2016 19:45:34 -0500 Subject: [PATCH] libxl: tidy libxl_get_scheduler() according to CODING_STYLE To more closely follow the guidelines in CODING_STYLE, store the result of xc_sched_id() in the local variable r, and the check the result of the call in a separate statement. Change the type of the output parameter given to xc_sched_id() from libxl_scheduler to int to match the libxc interface. Additionally, change the error log statement to more accurately reflect the failure. This is the only functional change introduced by this patch. Suggested-by: Ian Campbell Signed-off-by: Chester Lin Reviewed-by: Dario Faggioli Acked-by: Ian Campbell --- tools/libxl/libxl.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c index 2bde0f56da..52fefc0590 100644 --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -5580,10 +5580,12 @@ out: libxl_scheduler libxl_get_scheduler(libxl_ctx *ctx) { - libxl_scheduler sched, ret; + int r, sched; + GC_INIT(ctx); - if ((ret = xc_sched_id(ctx->xch, (int *)&sched)) != 0) { - LOGE(ERROR, "getting domain info list"); + r = xc_sched_id(ctx->xch, &sched); + if (r != 0) { + LOGE(ERROR, "getting current scheduler id"); return ERROR_FAIL; GC_FREE; } -- 2.39.5