diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c index 855b42c831..0294844ac4 100644 --- a/tools/libxl/libxl_create.c +++ b/tools/libxl/libxl_create.c @@ -883,6 +883,13 @@ static void initiate_domain_create(libxl__egc *egc, goto error_out; } + if (d_config->c_info.type == LIBXL_DOMAIN_TYPE_HVM && + (libxl_defbool_val(d_config->b_info.u.hvm.nested_hvm) && + libxl_defbool_val(d_config->b_info.u.hvm.altp2m))) { + LOG(ERROR, "nestedhvm and altp2mhvm cannot be used together"); + goto error_out; + } + for (i = 0; i < d_config->num_disks; i++) { ret = libxl__device_disk_setdefault(gc, &d_config->disks[i]); if (ret) { diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index d0bf0cb924..9755d55260 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -1568,14 +1568,6 @@ static void parse_config_data(const char *config_source, xlu_cfg_get_defbool(config, "altp2mhvm", &b_info->u.hvm.altp2m, 0); - if (!libxl_defbool_is_default(b_info->u.hvm.nested_hvm) && - libxl_defbool_val(b_info->u.hvm.nested_hvm) && - !libxl_defbool_is_default(b_info->u.hvm.altp2m) && - libxl_defbool_val(b_info->u.hvm.altp2m)) { - fprintf(stderr, "ERROR: nestedhvm and altp2mhvm cannot be used together\n"); - exit(1); - } - xlu_cfg_replace_string(config, "smbios_firmware", &b_info->u.hvm.smbios_firmware, 0); xlu_cfg_replace_string(config, "acpi_firmware",