Am Tue, 18 Feb 2020 18:37:09 +0100 schrieb Paolo Bonzini : > On 18/02/20 18:27, Olaf Hering wrote: > > The approach below (making 'xenfv' an alias of 'pc') does not work: > > xen_enabled() is false when pc_i440fx_3_1_machine_options runs. > Don't use an alias, copy the 3.1 code into the xenfv machine type and/or > call the 3.1 functions from the xenfv machine type. In the end it may look like this. Let me know about any preferences regarding the naming of configure options and variables. Olaf diff --git a/configure b/configure index 6f5d850949..65ca345fd6 100755 --- a/configure +++ b/configure @@ -368,6 +368,7 @@ vnc_jpeg="" vnc_png="" xkbcommon="" xen="" +xen_hvm_pc_i440fx_version_3_1="" xen_ctrl_version="" xen_pci_passthrough="" linux_aio="" @@ -1162,6 +1163,10 @@ for opt do ;; --enable-xen-pci-passthrough) xen_pci_passthrough="yes" ;; + --disable-xenfv-i440fx-version-3_1) xen_hvm_pc_i440fx_version_3_1="no" + ;; + --enable-xenfv-i440fx-version-3_1) xen_hvm_pc_i440fx_version_3_1="yes" + ;; --disable-brlapi) brlapi="no" ;; --enable-brlapi) brlapi="yes" @@ -7836,6 +7841,9 @@ if supported_xen_target $target; then if test "$xen_pci_passthrough" = yes; then echo "CONFIG_XEN_PCI_PASSTHROUGH=y" >> "$config_target_mak" fi + if test "$xen_hvm_pc_i440fx_version_3_1" = yes; then + echo "CONFIG_XEN_HVM_PC_I440FX_VERSION_3_1=y" >> "$config_target_mak" + fi else echo "$target/config-devices.mak: CONFIG_XEN=n" >> $config_host_mak fi diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index fa12203079..83d1fcc0ba 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -949,6 +949,11 @@ DEFINE_PC_MACHINE(isapc, "isapc", pc_init_isa, #ifdef CONFIG_XEN static void xenfv_machine_options(MachineClass *m) { +#ifdef CONFIG_XEN_HVM_PC_I440FX_VERSION_3_1 + pc_i440fx_3_1_machine_options(m); +#else + pc_i440fx_4_2_machine_options(m); +#endif m->desc = "Xen Fully-virtualized PC"; m->max_cpus = HVM_MAX_VCPUS; m->default_machine_opts = "accel=xen";