Skip to contentSkip to conversation

xl: print sxp on dry-run of create

PATCH In review Ian Campbell 2 participants 2 messages Jun 1, 2011 – Jun 2, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xl: print sxp on dry-run of create

# HG changeset patch
# User Ian Campbell <[email protected]> # Date 1306932694 -3600
# Node ID 064a0d9f710a183928df7b8fa25f66f202c96abb # Parent 8533cc275ece6d551c9d7b81e5fa4d9d24e03157
xl: print sxp on dry-run of create.

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).

tools/libxl/xl_cmdimpl.c +5 -5
diff -r 8533cc275ece -r 064a0d9f710a tools/libxl/xl_cmdimpl.c
@@ -1503,10 +1503,6 @@ static int create_domain(struct domain_c
 
     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
@@ -1525,9 +1521,13 @@ static int create_domain(struct domain_c
         }
     }
 
-    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;
Acked-by on v1 1/1
#1 lore raw

Ian Campbell writes ("[Xen-devel] [PATCH] xl: print sxp on dry-run of create"):

Quoted 1 line

xl: print sxp on dry-run of create.

Right. I think xl restore should get a dry run option too.

Quoted 4 lines

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).

Presumably it wants to know the domain name which would be created, because that's not necessarily related to the name of the config file.

Quoted 2 lines