From: Andrew Cooper Date: Fri, 26 Jan 2018 19:03:12 +0000 (+0000) Subject: tools/libxl: Fix assertion failure when trying to build a nested-virt PVH domain X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~668 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=43cc31b4778ed8313c4324547da1f46037132c52;p=xen.git tools/libxl: Fix assertion failure when trying to build a nested-virt PVH domain 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 Acked-by: Ian Jackson --- diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index 3812e67d45..c498135246 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;