Skip to contentSkip to conversation

xl: Suppress spurious warning message for cpupool-list

PATCH In review George Dunlap 3 participants 4 messages Nov 20, 2012 – Nov 29, 2012

lore
Share & tools
lore
#0 lore raw

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;
     }
#1 lore raw

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 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;
     }
 
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

Acked-by on v1 1/1
#2 lore raw
In reply to George Dunlap
Quoted 13 lines · George Dunlap

# 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.

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.

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

#3 lore raw

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.