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.coop...@citrix.com>
---
CC: Ian Jackson <ian.jack...@eu.citrix.com>
CC: Wei Liu <wei.l...@citrix.com>
---
 tools/libxl/libxl_create.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 3812e67..c4981352 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -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;
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to