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

Re: [Xen-devel] [PATCH v3 1/5] libxl: tidy libxl_get_scheduler() according to CODING_STYLE



On Sun, 2016-01-24 at 19:45 -0500, Chester Lin wrote:
> 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@xxxxxxxxxx>
> Signed-off-by: Chester Lin <czylin@xxxxxxxxxxxx>
> Reviewed-by: Dario Faggioli <dario.faggioli@xxxxxxxxxx>

Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>


> 
> ---
> Now storing the return of xc_sched_id in an int as per
> Â On Mon, 2016-01-04 at 16:23 +0000, Ian Campbell wrote:
> Â >Safer (and cleaner looking even if I'm wrong) would be to use a
> temporary
> Â >int for the function call and turn it into an enum implicitly in the
> return
> ---
> Â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 9207621..7f28af8 100644
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -5585,10 +5585,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;
> ÂÂÂÂÂ}

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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