xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [PATCH] xl: Suppress spurious warning message for cpupool-list
Date: Tue, 20 Nov 2012 16:09:44 +0000	[thread overview]
Message-ID: <ab313e9521f44bdd91a2.1353427784@elijah> (raw)

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

             reply	other threads:[~2012-11-20 16:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-20 16:09 George Dunlap [this message]
2012-11-21 10:27 ` [PATCH] xl: Suppress spurious warning message for cpupool-list George Dunlap
2012-11-23 11:09 ` Ian Campbell
2012-11-29 14:59   ` Ian Jackson
  -- strict thread matches above, loose matches on Subject: below --
2012-08-15  9:28 George Dunlap
2012-08-17  8:21 ` Ian Campbell
2012-08-17  8:23   ` Ian Campbell
2012-08-31  8:16   ` Ian Campbell
2012-11-20 16:03   ` George Dunlap
2012-11-20 16:08     ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ab313e9521f44bdd91a2.1353427784@elijah \
    --to=george.dunlap@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).