]> xenbits.xensource.com Git - people/tklengyel/xen.git/commitdiff
xl: allow config filename to precede options
authorIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 25 Feb 2011 18:43:48 +0000 (18:43 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 25 Feb 2011 18:43:48 +0000 (18:43 +0000)
"xm create" supports options which follow the domain config filename.
So xl should do as well.

This is an ad-hoc fixup to the "xl create" command line parser.  We
should revisit the xl command line parser in 4.2.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Reported-by: W. Michael Petullo <mike@flyn.org>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/xl_cmdimpl.c

index fe136eeab6b2205e211b8b898a04802430d7978d..2dd0f29e710ec7ebdb064da2c0469be2f5319892 100644 (file)
@@ -3253,6 +3253,11 @@ int main_create(int argc, char **argv)
         {0, 0, 0, 0}
     };
 
+    if (argv[1] && argv[1][0] != '-' && !strchr(argv[1], '=')) {
+        filename = argv[1];
+        argc--; argv++;
+    }
+
     while (1) {
         opt = getopt_long(argc, argv, "hnqf:pcde", long_options, &option_index);
         if (opt == -1)