]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commitdiff
libxl: tidy libxl_get_scheduler() according to CODING_STYLE
authorChester Lin <czylin@uwaterloo.ca>
Mon, 25 Jan 2016 00:45:34 +0000 (19:45 -0500)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 26 Jan 2016 16:26:43 +0000 (16:26 +0000)
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 <ian.campbell@citrix.com>
Signed-off-by: Chester Lin <czylin@uwaterloo.ca>
Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/libxl.c

index 2bde0f56da4a6f4a47bcc8db18293744ae43c335..52fefc0590e3e1ca6a173ab5234ab0b6b5566975 100644 (file)
@@ -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;
     }