WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] xl: fixup command line handling for sever

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xl: fixup command line handling for several commands.
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Sat, 01 Oct 2011 03:33:10 +0100
Delivery-date: Fri, 30 Sep 2011 19:33:30 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1317307234 -3600
# Node ID cd60c87d34963bcbd7e5ea6450a8afae3ffbc757
# Parent  145e146876b33d783e18a8ac5ebb8180f40d1720
xl: fixup command line handling for several commands.

def_getopt already checks for a minimum number of arguments for us.

"xl save" simply need to use the correct argument for that value,
contrary to the change I made in 23876:b113d626cfaf

"xl block-list" does not need to check for at least 2 arguments, since
it's already been done by def_getopt.

"xl network-list" would previous accept zero arguments and just print
the table header. Insist on a domain argument.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r 145e146876b3 -r cd60c87d3496 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Thu Sep 29 15:26:04 2011 +0100
+++ b/tools/libxl/xl_cmdimpl.c  Thu Sep 29 15:40:34 2011 +0100
@@ -2866,7 +2866,7 @@
     int checkpoint = 0;
     int opt;
 
-    while ((opt = def_getopt(argc, argv, "c", "save", 1)) != -1) {
+    while ((opt = def_getopt(argc, argv, "c", "save", 2)) != -1) {
         switch (opt) {
         case 0: case 2:
             return opt;
@@ -2876,7 +2876,7 @@
         }
     }
 
-    if (argc-optind < 2 || argc-optind > 3) {
+    if (argc-optind > 3) {
         help("save");
         return 2;
     }
@@ -4025,7 +4025,7 @@
     libxl_nicinfo *nics;
     unsigned int nb, i;
 
-    if ((opt = def_getopt(argc, argv, "", "network-list", 0)) != -1)
+    if ((opt = def_getopt(argc, argv, "", "network-list", 1)) != -1)
         return opt;
 
     /*      Idx  BE   MAC   Hdl  Sta  evch txr/rxr  BE-path */
@@ -4096,10 +4096,6 @@
 
     if ((opt = def_getopt(argc, argv, "", "block-attach", 2)) != -1)
         return opt;
-    if ((argc-optind < 2)) {
-        help("block-attach");
-        return 2;
-    }
 
     if (domain_qualifier_to_domid(argv[optind], &fe_domid, 0) < 0) {
         fprintf(stderr, "%s is an invalid domain identifier\n", argv[optind]);

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xl: fixup command line handling for several commands., Xen patchbot-unstable <=