George Dunlap
2012-Nov-20 16:09 UTC
[PATCH] xl: Suppress spurious warning message for cpupool-list
# HG changeset patch # User George Dunlap <george.dunlap@eu.citrix.com> # Date 1353427397 0 # Node ID ab313e9521f44bdd91a20a1b3eb499b2ee321b5e # Parent ae6fb202b233af815466055d9f1a635802a50855 xl: Suppress spurious warning message for cpupool-list libxl_cpupool_list() enumerates the cpupools by "probing": calling cpupool_info, starting at 0 and stopping when it gets an error. However, cpupool_info will print an error when the call to xc_cpupool_getinfo() fails, resulting in every xl command that uses libxl_list_cpupool (such as cpupool-list) printing that error message spuriously. Since at the moment the times we want to print the message correspond with the use of the existing "exact" parameter, use it to decide whether to print the message or not. Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c --- a/tools/libxl/libxl.c +++ b/tools/libxl/libxl.c @@ -593,7 +593,8 @@ static int cpupool_info(libxl__gc *gc, xcinfo = xc_cpupool_getinfo(CTX->xch, poolid); if (xcinfo == NULL) { - LOGE(ERROR, "failed to get info for cpupool%d\n", poolid); + if (exact || errno != ENOENT) + LOGE(ERROR, "failed to get info for cpupool%d\n", poolid); return ERROR_FAIL; }
George Dunlap
2012-Nov-21 10:27 UTC
Re: [PATCH] xl: Suppress spurious warning message for cpupool-list
I suppose I should have labelled this one "v2" -- oops. :-) -George On Tue, Nov 20, 2012 at 4:09 PM, George Dunlap <george.dunlap@eu.citrix.com>wrote:> # HG changeset patch > # User George Dunlap <george.dunlap@eu.citrix.com> > # Date 1353427397 0 > # Node ID ab313e9521f44bdd91a20a1b3eb499b2ee321b5e > # Parent ae6fb202b233af815466055d9f1a635802a50855 > xl: Suppress spurious warning message for cpupool-list > > libxl_cpupool_list() enumerates the cpupools by "probing": calling > cpupool_info, starting at 0 and stopping when it gets an error. However, > cpupool_info will print an error when the call to xc_cpupool_getinfo() > fails, > resulting in every xl command that uses libxl_list_cpupool (such as > cpupool-list) printing that error message spuriously. > > Since at the moment the times we want to print the message correspond > with the use of the existing "exact" parameter, use it to decide > whether to print the message or not. > > Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> > > diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c > --- a/tools/libxl/libxl.c > +++ b/tools/libxl/libxl.c > @@ -593,7 +593,8 @@ static int cpupool_info(libxl__gc *gc, > xcinfo = xc_cpupool_getinfo(CTX->xch, poolid); > if (xcinfo == NULL) > { > - LOGE(ERROR, "failed to get info for cpupool%d\n", poolid); > + if (exact || errno != ENOENT) > + LOGE(ERROR, "failed to get info for cpupool%d\n", poolid); > return ERROR_FAIL; > } > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Ian Campbell
2012-Nov-23 11:09 UTC
Re: [PATCH] xl: Suppress spurious warning message for cpupool-list
On Tue, 2012-11-20 at 16:09 +0000, George Dunlap wrote:> # HG changeset patch > # User George Dunlap <george.dunlap@eu.citrix.com> > # Date 1353427397 0 > # Node ID ab313e9521f44bdd91a20a1b3eb499b2ee321b5e > # Parent ae6fb202b233af815466055d9f1a635802a50855 > xl: Suppress spurious warning message for cpupool-list > > libxl_cpupool_list() enumerates the cpupools by "probing": calling > cpupool_info, starting at 0 and stopping when it gets an error. However, > cpupool_info will print an error when the call to xc_cpupool_getinfo() fails, > resulting in every xl command that uses libxl_list_cpupool (such as > cpupool-list) printing that error message spuriously. > > Since at the moment the times we want to print the message correspond > with the use of the existing "exact" parameter, use it to decide > whether to print the message or not. > > Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>Acked-by: Ian Campbell <ian.campbell@citrix.com> + applied, thanks. Ian J -- a 4.2 backport candidate.> > diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c > --- a/tools/libxl/libxl.c > +++ b/tools/libxl/libxl.c > @@ -593,7 +593,8 @@ static int cpupool_info(libxl__gc *gc, > xcinfo = xc_cpupool_getinfo(CTX->xch, poolid); > if (xcinfo == NULL) > { > - LOGE(ERROR, "failed to get info for cpupool%d\n", poolid); > + if (exact || errno != ENOENT) > + LOGE(ERROR, "failed to get info for cpupool%d\n", poolid); > return ERROR_FAIL; > } > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel
Ian Jackson
2012-Nov-29 14:59 UTC
Re: [PATCH] xl: Suppress spurious warning message for cpupool-list
Ian Campbell writes ("Re: [Xen-devel] [PATCH] xl: Suppress spurious warning message for cpupool-list"):> > xl: Suppress spurious warning message for cpupool-list...> Acked-by: Ian Campbell <ian.campbell@citrix.com> + applied, thanks. > > Ian J -- a 4.2 backport candidate.Done, thanks. Ian.