]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
tools/libxl: Fix assertion failure when trying to build a nested-virt PVH domain
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 26 Jan 2018 19:03:12 +0000 (19:03 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 29 Jan 2018 15:51:55 +0000 (15:51 +0000)
xl: libxl.c:339: libxl_defbool_val: Assertion `!libxl_defbool_is_default(db)' failed.

This happens because initiate_domain_create() checks for type != HVM, then
pokes at the hvm union.  Check for == HVM instead so the union access is
correctly guarded.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl_create.c

index 3812e67d459974708c556f7a668fc563a7b2c72f..c49813524684d34bb863d4a92a30caa86b3d60d4 100644 (file)
@@ -939,7 +939,7 @@ static void initiate_domain_create(libxl__egc *egc,
 
     if (d_config->c_info.type != LIBXL_DOMAIN_TYPE_PV &&
         (libxl_defbool_val(d_config->b_info.nested_hvm) &&
-        ((d_config->c_info.type != LIBXL_DOMAIN_TYPE_HVM &&
+        ((d_config->c_info.type == LIBXL_DOMAIN_TYPE_HVM &&
           libxl_defbool_val(d_config->b_info.u.hvm.altp2m)) ||
         (d_config->b_info.altp2m != LIBXL_ALTP2M_MODE_DISABLED)))) {
         ret = ERROR_INVAL;