xl: Suppress spurious warning message for cpupool-list
PATCH 1/1 xl: Suppress spurious warning message for cpupool-list
# HG changeset patch
# User George Dunlap <[email protected]> # 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.
tools/libxl/libxl.c +2 -1
@@ -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 ; }
I suppose I should have labelled this one "v2" -- oops. :-)
-George
Quoted 34 lines · George Dunlap
# HG changeset patch
# User George Dunlap <[email protected]> # Date 1353427397 0
# Node IDab313e9521f44bdd91a20a1b3eb499b2ee321b5e# Parentae6fb202b233af815466055d9f1a635802a50855
xl: Suppress spurious warning message for cpupool-list
libxl_cpupool_list()enumerates the cpupools by "probing": callingcpupool_info, starting at 0 and stopping when it gets an error. However,cpupool_infowill print an error when the call toxc_cpupool_getinfo()fails,
resulting in every xl command that useslibxl_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 <[email protected]>tools/libxl/libxl.c +2
-1@@ -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 ; }
Quoted 5 lines
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 13 lines · George Dunlap
# HG changeset patch
# User George Dunlap <[email protected]> # Date 1353427397 0
# Node IDab313e9521f44bdd91a20a1b3eb499b2ee321b5e# Parentae6fb202b233af815466055d9f1a635802a50855
xl: Suppress spurious warning message for cpupool-list
libxl_cpupool_list()enumerates the cpupools by "probing": callingcpupool_info, starting at 0 and stopping when it gets an error. However,cpupool_infowill print an error when the call toxc_cpupool_getinfo()fails, resulting in every xl command that useslibxl_list_cpupool(such as cpupool-list) printing that error message spuriously.
Quoted 5 lines
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 <[email protected]>
Ian J -- a 4.2 backport candidate.
Quoted 19 lines
tools/libxl/libxl.c +2
-1@@ -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
[email protected]
http://lists.xen.org/xen-devel
Ian Campbell writes ("Re: [Xen-devel] [PATCH] xl: Suppress spurious warning message for cpupool-list"):
Quoted 1 line
Quoted 1 line
xl: Suppress spurious warning message for cpupool-list
...
Quoted 3 lines
Ian J -- a 4.2 backport candidate.
Done, thanks.
Ian.