From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51540) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsEvO-0005Nj-12 for qemu-devel@nongnu.org; Fri, 30 Oct 2015 15:01:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZsEvN-0002Hi-2U for qemu-devel@nongnu.org; Fri, 30 Oct 2015 15:01:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60415) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsEvM-0002HX-U8 for qemu-devel@nongnu.org; Fri, 30 Oct 2015 15:01:17 -0400 From: Eduardo Habkost Date: Fri, 30 Oct 2015 17:00:59 -0200 Message-Id: <1446231660-24394-3-git-send-email-ehabkost@redhat.com> In-Reply-To: <1446231660-24394-1-git-send-email-ehabkost@redhat.com> References: <1446231660-24394-1-git-send-email-ehabkost@redhat.com> Subject: [Qemu-devel] [PATCH 2/3] pc: Create pc_compat_2_4() function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Igor Mammedov , Richard Henderson , "Michael S. Tsirkin" 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 --- 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