* [PATCH v3 1/5] libxl: tidy libxl_get_scheduler() according to CODING_STYLE
@ 2016-01-25 0:45 Chester Lin
2016-01-25 11:55 ` Ian Campbell
0 siblings, 1 reply; 3+ messages in thread
From: Chester Lin @ 2016-01-25 0:45 UTC (permalink / raw)
To: xen-devel
Cc: wei.liu2, ian.campbell, stefano.stabellini, dario.faggioli,
ian.jackson, Chester Lin, jtotto, hjarmstr
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>
---
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;
}
--
1.9.5.msysgit.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v3 1/5] libxl: tidy libxl_get_scheduler() according to CODING_STYLE
2016-01-25 0:45 [PATCH v3 1/5] libxl: tidy libxl_get_scheduler() according to CODING_STYLE Chester Lin
@ 2016-01-25 11:55 ` Ian Campbell
2016-01-26 16:52 ` Ian Campbell
0 siblings, 1 reply; 3+ messages in thread
From: Ian Campbell @ 2016-01-25 11:55 UTC (permalink / raw)
To: Chester Lin, xen-devel
Cc: wei.liu2, stefano.stabellini, dario.faggioli, ian.jackson, jtotto,
hjarmstr
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@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>
>
> ---
> 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@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3 1/5] libxl: tidy libxl_get_scheduler() according to CODING_STYLE
2016-01-25 11:55 ` Ian Campbell
@ 2016-01-26 16:52 ` Ian Campbell
0 siblings, 0 replies; 3+ messages in thread
From: Ian Campbell @ 2016-01-26 16:52 UTC (permalink / raw)
To: Chester Lin, xen-devel
Cc: wei.liu2, stefano.stabellini, dario.faggioli, ian.jackson, jtotto,
hjarmstr
On Mon, 2016-01-25 at 11:55 +0000, Ian Campbell wrote:
> 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@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>
Applied, thanks.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-01-26 16:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-25 0:45 [PATCH v3 1/5] libxl: tidy libxl_get_scheduler() according to CODING_STYLE Chester Lin
2016-01-25 11:55 ` Ian Campbell
2016-01-26 16:52 ` Ian Campbell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).