libxl_domain_config *d_config,
xc_domain_configuration_t *xc_config)
{
-
- if (d_config->c_info.type == LIBXL_DOMAIN_TYPE_HVM) {
- if (d_config->b_info.device_model_version !=
- LIBXL_DEVICE_MODEL_VERSION_NONE) {
- xc_config->emulation_flags = XEN_X86_EMU_ALL;
- } else if (libxl_defbool_val(d_config->b_info.apic)) {
- /*
- * HVM guests without device model may want
- * to have LAPIC emulation.
- */
+ switch(d_config->c_info.type) {
+ case LIBXL_DOMAIN_TYPE_HVM:
+ xc_config->emulation_flags = XEN_X86_EMU_ALL;
+ break;
+ case LIBXL_DOMAIN_TYPE_PVH:
+ if (libxl_defbool_val(d_config->b_info.apic))
+ /* PVH guests may want to have LAPIC emulation. */
xc_config->emulation_flags = XEN_X86_EMU_LAPIC;
- }
- } else {
+ else
+ xc_config->emulation_flags = 0;
+ break;
+ case LIBXL_DOMAIN_TYPE_PV:
xc_config->emulation_flags = 0;
+ break;
+ default:
+ abort();
}
return 0;
struct e820entry map[E820MAX];
libxl_domain_build_info *b_info;
- if (d_config == NULL || d_config->c_info.type == LIBXL_DOMAIN_TYPE_HVM)
+ if (d_config == NULL || d_config->c_info.type != LIBXL_DOMAIN_TYPE_PV)
return ERROR_INVAL;
b_info = &d_config->b_info;
if (rtc_timeoffset)
xc_domain_set_time_offset(ctx->xch, domid, rtc_timeoffset);
- if (d_config->b_info.type == LIBXL_DOMAIN_TYPE_HVM) {
+ if (d_config->b_info.type != LIBXL_DOMAIN_TYPE_PV) {
unsigned long shadow = DIV_ROUNDUP(d_config->b_info.shadow_memkb,
1024);
xc_shadow_control(ctx->xch, domid, XEN_DOMCTL_SHADOW_OP_SET_ALLOCATION,
{
int rc = 0;
- if ((info->type == LIBXL_DOMAIN_TYPE_HVM) &&
- (info->device_model_version == LIBXL_DEVICE_MODEL_VERSION_NONE)) {
+ if (info->type == LIBXL_DOMAIN_TYPE_PVH) {
rc = libxl__dom_load_acpi(gc, info, dom);
if (rc != 0)
LOGE(ERROR, "libxl_dom_load_acpi failed");