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

[Xen-devel] [PATCH 09/11] xl: implement -N (dry run) global option for create and cpupool-create



These subcommands already had "-n" dry run options.  Make -N do the
same thing, and deprecate those -n options.

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 tools/libxl/xl_cmdimpl.c  |   11 +++++------
 tools/libxl/xl_cmdtable.c |   10 ++++++----
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 208e745..5c63686 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -3034,7 +3034,7 @@ int main_create(int argc, char **argv)
     char extra_config[1024];
     struct domain_create dom_info;
     int paused = 0, debug = 0, daemonize = 1, console_autoconnect = 0,
-        dryrun = 0, quiet = 0, monitor = 1;
+        quiet = 0, monitor = 1;
     int opt, rc;
     int option_index = 0;
     static struct option long_options[] = {
@@ -3079,7 +3079,7 @@ int main_create(int argc, char **argv)
             help("create");
             return 0;
         case 'n':
-            dryrun = 1;
+            dryrun_only = 1;
             break;
         case 'q':
             quiet = 1;
@@ -3108,7 +3108,7 @@ int main_create(int argc, char **argv)
     dom_info.daemonize = daemonize;
     dom_info.monitor = monitor;
     dom_info.paused = paused;
-    dom_info.dryrun = dryrun;
+    dom_info.dryrun = dryrun_only;
     dom_info.quiet = quiet;
     dom_info.config_file = filename;
     dom_info.extra_config = extra_config;
@@ -4564,7 +4564,6 @@ int main_cpupoolcreate(int argc, char **argv)
     const char *filename = NULL;
     const char *p;
     char extra_config[1024];
-    int dryrun = 0;
     int opt;
     int option_index = 0;
     static struct option long_options[] = {
@@ -4603,7 +4602,7 @@ int main_cpupoolcreate(int argc, char **argv)
             help("cpupool-create");
             return 0;
         case 'n':
-            dryrun = 1;
+            dryrun_only = 1;
             break;
         default:
             fprintf(stderr, "option `%c' not supported.\n", optopt);
@@ -4755,7 +4754,7 @@ int main_cpupoolcreate(int argc, char **argv)
     printf("scheduler:      %s\n", sched);
     printf("number of cpus: %d\n", n_cpus);
 
-    if (dryrun)
+    if (dryrun_only)
         return 0;
 
     poolid = 0;
diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c
index 5308288..924920b 100644
--- a/tools/libxl/xl_cmdtable.c
+++ b/tools/libxl/xl_cmdtable.c
@@ -19,7 +19,7 @@
 
 struct cmd_spec cmd_table[] = {
     { "create",
-      &main_create, 0,
+      &main_create, 1,
       "Create a domain from config file <filename>",
       "<ConfigFile> [options] [vars]",
       "-h                      Print this help.\n"
@@ -27,7 +27,8 @@ struct cmd_spec cmd_table[] = {
       "-c                      Connect to the console after the domain is 
created.\n"
       "-f=FILE, --defconfig=FILE\n                     Use the given 
configuration file.\n"
       "-q, --quiet             Quiet.\n"
-      "-n, --dryrun            Dry run - prints the resulting configuration.\n"
+      "-n, --dryrun            Dry run - prints the resulting configuration\n"
+      "                         (deprecated in favour of global -N option).\n"
       "-d                      Enable debug messages.\n"
       "-e                      Do not wait in the background for the death of 
the domain."
     },
@@ -322,12 +323,13 @@ struct cmd_spec cmd_table[] = {
       "",
     },
     { "cpupool-create",
-      &main_cpupoolcreate, 0,
+      &main_cpupoolcreate, 1,
       "Create a CPU pool based an ConfigFile",
       "[options] <ConfigFile> [vars]",
       "-h, --help                   Print this help.\n"
       "-f=FILE, --defconfig=FILE    Use the given configuration file.\n"
-      "-n, --dryrun                 Dry run - prints the resulting 
configuration."
+      "-n, --dryrun                 Dry run - prints the resulting 
configuration.\n"
+      "                              (deprecated in favour of global -N 
option)."
     },
     { "cpupool-list",
       &main_cpupoollist, 0,
-- 
1.5.6.5


_______________________________________________
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®.