=back
+=head3 HVM without a device model options
+
+This options can be used to change the set of emulated devices provided
+to guests without a device model. Note that Xen might not support all
+possible combinations. By default HVM guests without a device model
+don't have any of them enabled.
+
+=over 4
+
+=item B<lapic=BOOLEAN>
+
+Enables or disables the Local APIC.
+
+=item B<ioapic=BOOLEAN>
+
+Enables or disables the IO APIC.
+
+=item B<rtc=BOOLEAN>
+
+Enables or disables the RTC.
+
+=item B<power_management=BOOLEAN>
+
+Enables or disables the ACPI power management timer and control interfaces.
+
+=item B<pic=BOOLEAN>
+
+Enables or disables the PIC.
+
+=item B<pit=BOOLEAN>
+
+Enables or disables the PIT.
+
+=item B<hpet=BOOLEAN>
+
+Enables or disables the HPET.
+
+=back
+
=head2 Device-Model Options
The following options control the selection of the device-model. This
*/
#define LIBXL_HAVE_DEVICE_MODEL_VERSION_NONE 1
+/*
+ * LIBXL_HAVE_EMULATED_DEVS_OPTIONS
+ *
+ * In the case that LIBXL_HAVE_EMULATED_DEVS_OPTIONS is set libxl
+ * allows enabling or disabling emulated devices for HVM guests
+ * without a device model. The following fields are added to the
+ * hvm structure inside of libxl_domain_build_info: lapic, ioapic,
+ * rtc, power_management, pic, pit.
+ */
+#define LIBXL_HAVE_EMULATED_DEVS_OPTIONS 1
+
typedef char **libxl_string_list;
void libxl_string_list_dispose(libxl_string_list *sl);
int libxl_string_list_length(const libxl_string_list *sl);
libxl_defbool_setdefault(&b_info->u.hvm.acpi_s4, true);
libxl_defbool_setdefault(&b_info->u.hvm.nx, true);
libxl_defbool_setdefault(&b_info->u.hvm.viridian, false);
- libxl_defbool_setdefault(&b_info->u.hvm.hpet, true);
libxl_defbool_setdefault(&b_info->u.hvm.vpt_align, true);
libxl_defbool_setdefault(&b_info->u.hvm.nested_hvm, false);
libxl_defbool_setdefault(&b_info->u.hvm.altp2m, false);
libxl_defbool_setdefault(&b_info->u.hvm.usb, false);
libxl_defbool_setdefault(&b_info->u.hvm.xen_platform_pci, true);
+ if (b_info->type == LIBXL_DOMAIN_TYPE_HVM &&
+ b_info->device_model_version == LIBXL_DEVICE_MODEL_VERSION_NONE)
+ {
+ libxl_defbool_setdefault(&b_info->u.hvm.hpet, false);
+ libxl_defbool_setdefault(&b_info->u.hvm.lapic, false);
+ libxl_defbool_setdefault(&b_info->u.hvm.ioapic, false);
+ libxl_defbool_setdefault(&b_info->u.hvm.rtc, false);
+ libxl_defbool_setdefault(&b_info->u.hvm.power_management, false);
+ libxl_defbool_setdefault(&b_info->u.hvm.pic, false);
+ libxl_defbool_setdefault(&b_info->u.hvm.pit, false);
+ } else {
+ libxl_defbool_setdefault(&b_info->u.hvm.hpet, true);
+ libxl_defbool_setdefault(&b_info->u.hvm.lapic, true);
+ libxl_defbool_setdefault(&b_info->u.hvm.ioapic, true);
+ libxl_defbool_setdefault(&b_info->u.hvm.rtc, true);
+ libxl_defbool_setdefault(&b_info->u.hvm.power_management, true);
+ libxl_defbool_setdefault(&b_info->u.hvm.pic, true);
+ libxl_defbool_setdefault(&b_info->u.hvm.pit, true);
+ }
+
libxl_defbool_setdefault(&b_info->u.hvm.spice.enable, false);
if (!libxl_defbool_val(b_info->u.hvm.spice.enable) &&
(b_info->u.hvm.spice.usbredirection > 0) ){
("serial_list", libxl_string_list),
("rdm", libxl_rdm_reserve),
("rdm_mem_boundary_memkb", MemKB),
+ ("lapic", libxl_defbool),
+ ("ioapic", libxl_defbool),
+ ("rtc", libxl_defbool),
+ ("power_management", libxl_defbool),
+ ("pic", libxl_defbool),
+ ("pit", libxl_defbool),
])),
("pv", Struct(None, [("kernel", string),
("slack_memkb", MemKB),
libxl_domain_config *d_config,
xc_domain_configuration_t *xc_config)
{
+ struct libxl_domain_build_info *info = &d_config->b_info;
- if (d_config->c_info.type == LIBXL_DOMAIN_TYPE_HVM &&
- d_config->b_info.device_model_version !=
- LIBXL_DEVICE_MODEL_VERSION_NONE) {
- /* HVM domains with a device model. */
+ if (d_config->c_info.type == LIBXL_DOMAIN_TYPE_PV) {
+ /* PV guests. */
+ xc_config->emulation_flags = XEN_X86_EMU_PIT;
+ } else if (info->device_model_version != LIBXL_DEVICE_MODEL_VERSION_NONE) {
+ /* HVM guests with a device model. */
xc_config->emulation_flags = XEN_X86_EMU_ALL;
} else {
- /* PV or HVM domains without a device model. */
+ /* HVM guests without a device model. */
xc_config->emulation_flags = 0;
+
+ if (libxl_defbool_val(info->u.hvm.lapic))
+ xc_config->emulation_flags |= XEN_X86_EMU_LAPIC;
+ if (libxl_defbool_val(info->u.hvm.ioapic))
+ xc_config->emulation_flags |= XEN_X86_EMU_IOAPIC;
+ if (libxl_defbool_val(info->u.hvm.rtc))
+ xc_config->emulation_flags |= XEN_X86_EMU_RTC;
+ if (libxl_defbool_val(info->u.hvm.power_management))
+ xc_config->emulation_flags |= XEN_X86_EMU_PM;
+ if (libxl_defbool_val(info->u.hvm.pic))
+ xc_config->emulation_flags |= XEN_X86_EMU_PIC;
+ if (libxl_defbool_val(info->u.hvm.pit))
+ xc_config->emulation_flags |= XEN_X86_EMU_PIT;
+ if (libxl_defbool_val(info->u.hvm.hpet))
+ xc_config->emulation_flags |= XEN_X86_EMU_HPET;
+
+ if (info->u.hvm.vga.kind != LIBXL_VGA_INTERFACE_TYPE_NONE)
+ xc_config->emulation_flags |= XEN_X86_EMU_VGA;
+
+ if (d_config->num_pcidevs != 0)
+ xc_config->emulation_flags |= XEN_X86_EMU_IOMMU;
}
return 0;
xlu_cfg_get_defbool(config, "acpi_s4", &b_info->u.hvm.acpi_s4, 0);
xlu_cfg_get_defbool(config, "nx", &b_info->u.hvm.nx, 0);
xlu_cfg_get_defbool(config, "hpet", &b_info->u.hvm.hpet, 0);
+ xlu_cfg_get_defbool(config, "lapic", &b_info->u.hvm.lapic, 0);
+ xlu_cfg_get_defbool(config, "ioapic", &b_info->u.hvm.ioapic, 0);
+ xlu_cfg_get_defbool(config, "rtc", &b_info->u.hvm.rtc, 0);
+ xlu_cfg_get_defbool(config, "power_management",
+ &b_info->u.hvm.power_management, 0);
+ xlu_cfg_get_defbool(config, "pic", &b_info->u.hvm.pic, 0);
+ xlu_cfg_get_defbool(config, "pit", &b_info->u.hvm.pit, 0);
xlu_cfg_get_defbool(config, "vpt_align", &b_info->u.hvm.vpt_align, 0);
switch (xlu_cfg_get_list(config, "viridian",