Received: from eggs.gnu.org ([2001:4830:134:3::10]:51306) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwxOt-000338-03 for qemu-devel@nongnu.org; Fri, 05 Dec 2014 13:14:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XwxOk-0000Lo-NM for qemu-devel@nongnu.org; Fri, 05 Dec 2014 13:14:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56387) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XwxOk-0000Lg-Fb for qemu-devel@nongnu.org; Fri, 05 Dec 2014 13:14:34 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sB5IEXkW031404 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 5 Dec 2014 13:14:33 -0500 Date: Fri, 5 Dec 2014 16:14:30 -0200 From: Eduardo Habkost Message-ID: <20141205181430.GD5002@thinpad.lan.raisama.net> References: <1417801466-23485-1-git-send-email-pbonzini@redhat.com> <1417801466-23485-2-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1417801466-23485-2-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH 1/4] pc: add 2.3 machine types List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On Fri, Dec 05, 2014 at 06:44:23PM +0100, Paolo Bonzini wrote: > The next patch will differentiate them. > > Signed-off-by: Paolo Bonzini > --- > hw/i386/pc_piix.c | 28 +++++++++++++++++++++++++--- > hw/i386/pc_q35.c | 25 ++++++++++++++++++++++--- > 2 files changed, 47 insertions(+), 6 deletions(-) > > diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c > index 741dffd..5ad23d0 100644 > --- a/hw/i386/pc_piix.c > +++ b/hw/i386/pc_piix.c > @@ -303,6 +303,10 @@ static void pc_init_pci(MachineState *machine) > pc_init1(machine, 1, 1); > } > > +static void pc_compat_2_2(MachineState *machine) > +{ > +} > + > static void pc_compat_2_1(MachineState *machine) > { > PCMachineState *pcms = PC_MACHINE(machine); You need to make pc_compat_2_1() call pc_compat_2_2(). The same on pc_q35.c. > @@ -380,6 +384,12 @@ static void pc_compat_1_2(MachineState *machine) > x86_cpu_compat_kvm_no_autoenable(FEAT_KVM, KVM_FEATURE_PV_EOI); > } > > +static void pc_init_pci_2_2(MachineState *machine) > +{ > + pc_compat_2_2(machine); > + pc_init_pci(machine); > +} > + > static void pc_init_pci_2_1(MachineState *machine) > { > pc_compat_2_1(machine); > @@ -473,6 +483,19 @@ static void pc_xen_hvm_init(MachineState *machine) > .desc = "Standard PC (i440FX + PIIX, 1996)", \ > .hot_add_cpu = pc_hot_add_cpu > > +#define PC_I440FX_2_3_MACHINE_OPTIONS \ > + PC_I440FX_MACHINE_OPTIONS, \ > + .default_machine_opts = "firmware=bios-256k.bin", \ > + .default_display = "std" > + > +static QEMUMachine pc_i440fx_machine_v2_3 = { > + PC_I440FX_2_3_MACHINE_OPTIONS, > + .name = "pc-i440fx-2.3", > + .alias = "pc", > + .init = pc_init_pci, > + .is_default = 1, > +}; > + > #define PC_I440FX_2_2_MACHINE_OPTIONS \ > PC_I440FX_MACHINE_OPTIONS, \ I was going to suggest making PC_I440FX_2_2_MACHINE_OPTIONS reuse PC_I440FX_2_3_MACHINE_OPTIONS, but I think we have enough macro reuse mess here, and this is safer and simpler? > .default_machine_opts = "firmware=bios-256k.bin", \ > @@ -481,9 +504,7 @@ static void pc_xen_hvm_init(MachineState *machine) > static QEMUMachine pc_i440fx_machine_v2_2 = { > PC_I440FX_2_2_MACHINE_OPTIONS, > .name = "pc-i440fx-2.2", > - .alias = "pc", > - .init = pc_init_pci, > - .is_default = 1, > + .init = pc_init_pci_2_2, > }; > [...] -- Eduardo