We will need to call x86_cpu_change_kvm_default() for pc-2.4 too, so we will need a pc_compat_2_4() function.
I plan to fix this by adding a kvm_defaults list to PCMachineClass later, but while we don't have that, let's do it the easy way and add the new function. Signed-off-by: Eduardo Habkost <ehabk...@redhat.com> --- hw/i386/pc_piix.c | 12 +++++------- hw/i386/pc_q35.c | 12 +++++------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index fd4bbc9..d6616c4 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -294,16 +294,14 @@ static void pc_init1(MachineState *machine, } } -/* Looking for a pc_compat_2_4() function? It doesn't exist. - * pc_compat_*() functions that run on machine-init time and - * change global QEMU state are deprecated. Please don't create - * one, and implement any pc-*-2.4 (and newer) compat code in - * HW_COMPAT_*, PC_COMPAT_*, or * pc_*_machine_options(). - */ +static void pc_compat_2_4(MachineState *machine) +{ +} static void pc_compat_2_3(MachineState *machine) { PCMachineState *pcms = PC_MACHINE(machine); + pc_compat_2_4(machine); savevm_skip_section_footers(); if (kvm_enabled()) { pcms->smm = ON_OFF_AUTO_OFF; @@ -490,7 +488,7 @@ static void pc_i440fx_2_4_machine_options(MachineClass *m) SET_MACHINE_COMPAT(m, PC_COMPAT_2_4); } -DEFINE_I440FX_MACHINE(v2_4, "pc-i440fx-2.4", NULL, +DEFINE_I440FX_MACHINE(v2_4, "pc-i440fx-2.4", pc_compat_2_4, pc_i440fx_2_4_machine_options) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 833b1c1..b33fcdc 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -277,16 +277,14 @@ static void pc_q35_init(MachineState *machine) } } -/* Looking for a pc_compat_2_4() function? It doesn't exist. - * pc_compat_*() functions that run on machine-init time and - * change global QEMU state are deprecated. Please don't create - * one, and implement any pc-*-2.4 (and newer) compat code in - * HW_COMPAT_*, PC_COMPAT_*, or * pc_*_machine_options(). - */ +static void pc_compat_2_4(MachineState *machine) +{ +} static void pc_compat_2_3(MachineState *machine) { PCMachineState *pcms = PC_MACHINE(machine); + pc_compat_2_4(machine); savevm_skip_section_footers(); if (kvm_enabled()) { pcms->smm = ON_OFF_AUTO_OFF; @@ -388,7 +386,7 @@ static void pc_q35_2_4_machine_options(MachineClass *m) SET_MACHINE_COMPAT(m, PC_COMPAT_2_4); } -DEFINE_Q35_MACHINE(v2_4, "pc-q35-2.4", NULL, +DEFINE_Q35_MACHINE(v2_4, "pc-q35-2.4", pc_compat_2_4, pc_q35_2_4_machine_options); -- 2.1.0