diff mbox series

[XEN,for-4.13,v3,09/10] libxl: Move domain_create_info_setdefault earlier

Message ID 20191011165549.21639-6-ian.jackson@eu.citrix.com (mailing list archive)
State Superseded
Headers show
Series libxl memkb & pt defaulting | expand

Commit Message

Ian Jackson Oct. 11, 2019, 4:55 p.m. UTC
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>
---
v3: New patch in this version of the series.
---
 tools/libxl/libxl_create.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Comments

Anthony PERARD Oct. 14, 2019, 12:53 p.m. UTC | #1
On Fri, Oct 11, 2019 at 05:55:48PM +0100, Ian Jackson wrote:
> 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>
diff mbox series

Patch

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 69971c97b6..3d2cb52bf7 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -968,6 +968,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.
      */
@@ -1007,13 +1014,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 =