[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Unused Variable in xl code for CPU Pool


  • To: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
  • From: Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
  • Date: Thu, 02 Feb 2012 06:37:03 +0100
  • Cc: John McDermott <segfaultreloaded@xxxxxxxxx>, Andre Przywara <andre.przywara@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
  • Delivery-date: Thu, 02 Feb 2012 05:37:55 +0000
  • Domainkey-signature: s=s1536a; d=ts.fujitsu.com; c=nofws; q=dns; h=X-SBRSScore:X-IronPort-AV:Received:X-IronPort-AV: Received:Received:Message-ID:Date:From:Organization: User-Agent:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=F8FBmxMOfg7fjxlf2uYInpu3p2wjzRqo1RrfJnPUm2P79APxSGlYEwCD n1/1v/xZpBkaMEX35QOsoNi09WlxUqlQ7ba8jUH3VZZVuOjuaejQgi7QQ migDZFSsRxLLOC+xsQiu2Lqw+1VsCEXj8MTk5DQ1uGZggUeoz3dt4GURK ao130Q1EB4EChKuBfadz4Jkk9a+nO8T+bpzCFrPeJTPHYWRgQWOLiu1J2 2Tv+jda/ro5KisgqWPqBCixrLRzKC;
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

On 02/01/2012 03:48 PM, Ian Campbell wrote:
On Thu, 2012-01-26 at 13:15 +0000, John McDermott wrote:
Xen Developers,

FYI, in 4.1-testing, tools/libxl/xl_cmdimpl.c, in function
main_cpupoollist, the variable opt_long is set but not used. Tools
won't make with this warning.
Our test system compilers obviously don't generate this particular
warning so it slipped through. Thanks for reporting.

Looks like fallout from 22838:aab67c1c6b87 which removed the (nop)
implementation of that option.

The following just nukes it altogether, the generic handling of
unsupported options already prints something.

Ian.

# HG changeset patch
# User Ian Campbell<ian.campbell@xxxxxxxxxx>
# Date 1328107525 0
# Node ID 6e1db0380ba3467e26128706a62195bf2816e00e
# Parent  667da384457b0ec5f8f2ea4ec3c1ee43008e7ed5
xl: Drop -l option to xl cpupool-list

The implementation (which was a nop) was removed back in 22838:aab67c1c6b87 but
this now causes "set but not used" warnings from some compilers. Might as well
just nuke the option entirely.

Signed-off-by: Ian Campbell<ian.campbell@xxxxxxxxxx>

Acked-by: juergen.gross@xxxxxxxxxxxxxx

diff -r 667da384457b -r 6e1db0380ba3 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Wed Feb 01 14:45:25 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c  Wed Feb 01 14:45:25 2012 +0000
@@ -5538,11 +5538,9 @@ int main_cpupoollist(int argc, char **ar
      int option_index = 0;
      static struct option long_options[] = {
          {"help", 0, 0, 'h'},
-        {"long", 0, 0, 'l'},
          {"cpus", 0, 0, 'c'},
          {0, 0, 0, 0}
      };
-    int opt_long = 0;
      int opt_cpus = 0;
      const char *pool = NULL;
      libxl_cpupoolinfo *poolinfo;
@@ -5552,7 +5550,7 @@ int main_cpupoollist(int argc, char **ar
      int ret = 0;

      while (1) {
-        opt = getopt_long(argc, argv, "hlc", long_options,&option_index);
+        opt = getopt_long(argc, argv, "hc", long_options,&option_index);
          if (opt == -1)
              break;

@@ -5560,9 +5558,6 @@ int main_cpupoollist(int argc, char **ar
          case 'h':
              help("cpupool-list");
              return 0;
-        case 'l':
-            opt_long = 1;
-            break;
          case 'c':
              opt_cpus = 1;
              break;



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel




--
Juergen Gross                 Principal Developer Operating Systems
PDG ES&S SWE OS6                       Telephone: +49 (0) 89 3222 2967
Fujitsu Technology Solutions              e-mail: juergen.gross@xxxxxxxxxxxxxx
Domagkstr. 28                           Internet: ts.fujitsu.com
D-80807 Muenchen                 Company details: ts.fujitsu.com/imprint.html


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.