]> xenbits.xensource.com Git - people/iwj/xen.git/commitdiff
libxl: Move domain_create_info_setdefault earlier
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 11 Oct 2019 16:16:44 +0000 (17:16 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Fri, 18 Oct 2019 14:50:47 +0000 (15:50 +0100)
We need this before we start to figure out the passthrough mode.

I have checked that nothing in libxl__domain_create_info_setdefault
nor the two implementations of ..._arch_... accesses anything else,
other than (i) the domain type (which this function is responsible for
setting and nothing before it looks at) (ii) c_info->ssidref (which is
defaulted by flask code near the top of
libxl__domain_config_setdefault and not accessed afterwards).

So no functional change.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Anthony PERARD <anthony.perard@citrix.com>
---
v3: New patch in this version of the series.

tools/libxl/libxl_create.c

index 0670ef90ed5abfa035e9932358c0a52923b3186b..7869d54b320ef75dd887af91e89855a03a354ecb 100644 (file)
@@ -972,6 +972,13 @@ int libxl__domain_config_setdefault(libxl__gc *gc,
         goto error_out;
     }
 
+    ret = libxl__domain_create_info_setdefault(gc, &d_config->c_info,
+                                               &physinfo);
+    if (ret) {
+        LOGD(ERROR, domid, "Unable to set domain create info defaults");
+        goto error_out;
+    }
+
     /* If target_memkb is smaller than max_memkb, the subsequent call
      * to libxc when building HVM domain will enable PoD mode.
      */
@@ -1011,13 +1018,6 @@ int libxl__domain_config_setdefault(libxl__gc *gc,
         goto error_out;
     }
 
-    ret = libxl__domain_create_info_setdefault(gc, &d_config->c_info,
-                                               &physinfo);
-    if (ret) {
-        LOGD(ERROR, domid, "Unable to set domain create info defaults");
-        goto error_out;
-    }
-
     if (d_config->b_info.shadow_memkb == LIBXL_MEMKB_DEFAULT
         && ok_to_default_memkb_in_create(gc))
         d_config->b_info.shadow_memkb =