xl: print sxp on dry-run of create.
authorIan Campbell <ian.campbell@citrix.com>
Thu, 2 Jun 2011 16:36:02 +0000 (17:36 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 2 Jun 2011 16:36:02 +0000 (17:36 +0100)
The help text for xm create's --dry-run says "Dry run - prints the
resulting configuration in SXP but does not create the domain." so
update xl implementation to match. At least the xendomains initscript
relies on this (for better or worse).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Tested-by: Carsten Schiers <carsten@schiers.de>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/xl_cmdimpl.c

index ddd3c64e6d99fcbdccafb4ff7d70b2c3b2b4e9e6..ca0841d5e0bc54fb93e1d891476df13adb88c1a1 100644 (file)
@@ -1516,10 +1516,6 @@ static int create_domain(struct domain_create *dom_info)
 
     parse_config_data(config_file, config_data, config_len, &d_config, &d_config.dm_info);
 
-    ret = 0;
-    if (dom_info->dryrun)
-        goto out;
-
     if (migrate_fd >= 0) {
         if (d_config.c_info.name) {
             /* when we receive a domain we get its name from the config
@@ -1538,9 +1534,13 @@ static int create_domain(struct domain_create *dom_info)
         }
     }
 
-    if (debug)
+    if (debug || dom_info->dryrun)
         printf_info(-1, &d_config, &d_config.dm_info);
 
+    ret = 0;
+    if (dom_info->dryrun)
+        goto out;
+
 start:
     domid = -1;