From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6VZ4-00010E-G9 for qemu-devel@nongnu.org; Tue, 08 Dec 2015 22:37:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a6VZ3-00064C-EC for qemu-devel@nongnu.org; Tue, 08 Dec 2015 22:37:14 -0500 Received: from mail-pf0-x230.google.com ([2607:f8b0:400e:c00::230]:36810) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a6VZ3-000640-79 for qemu-devel@nongnu.org; Tue, 08 Dec 2015 22:37:13 -0500 Received: by pfdd184 with SMTP id d184so22584054pfd.3 for ; Tue, 08 Dec 2015 19:37:12 -0800 (PST) References: <1449459280-14983-1-git-send-email-david@gibson.dropbear.id.au> <1449459280-14983-10-git-send-email-david@gibson.dropbear.id.au> From: Alexey Kardashevskiy Message-ID: <5667A1E2.3010005@ozlabs.ru> Date: Wed, 9 Dec 2015 14:37:06 +1100 MIME-Version: 1.0 In-Reply-To: <1449459280-14983-10-git-send-email-david@gibson.dropbear.id.au> Content-Type: text/plain; charset=koi8-r; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCHv2 09/10] pseries: Improve setting of default machine version List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson , ehabkost@redhat.com, agraf@suse.de, mdroth@linux.vnet.ibm.com Cc: lvivier@redhat.com, thuth@redhat.com, qemu-ppc@nongnu.org, qemu-devel@nongnu.org On 12/07/2015 02:34 PM, David Gibson wrote: > This tweaks the way the default machine version is controlled, so that > there will be a bit less churn when each new version is introduced. > > Signed-off-by: David Gibson > --- > hw/ppc/spapr.c | 20 ++++++++++---------- > 1 file changed, 10 insertions(+), 10 deletions(-) > > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > index 5af3d13..8b8eb18 100644 > --- a/hw/ppc/spapr.c > +++ b/hw/ppc/spapr.c > @@ -2308,12 +2308,16 @@ static const TypeInfo spapr_machine_info = { > }, > }; > > -#define DEFINE_SPAPR_MACHINE(suffix, verstr) \ > +#define DEFINE_SPAPR_MACHINE(suffix, verstr, latest) \ > static void spapr_machine_##suffix##_class_init(ObjectClass *oc, \ > void *data) \ > { \ > MachineClass *mc = MACHINE_CLASS(oc); \ > spapr_machine_##suffix##_class_options(mc); \ > + if (latest) { \ > + mc->alias = "pseries"; \ > + mc->is_default = 1; \ > + } \ > } \ > static void spapr_machine_##suffix##_instance_init(Object *obj) \ > { \ > @@ -2342,11 +2346,9 @@ static void spapr_machine_2_5_instance_options(MachineState *machine) > static void spapr_machine_2_5_class_options(MachineClass *mc) > { > /* Defaults for the latest behaviour inherited from the base class */ > - mc->alias = "pseries"; > - mc->is_default = 1; > } > > -DEFINE_SPAPR_MACHINE(2_5, "2.5"); > +DEFINE_SPAPR_MACHINE(2_5, "2.5", true); > > /* > * pseries-2.4 > @@ -2364,13 +2366,11 @@ static void spapr_machine_2_4_class_options(MachineClass *mc) > sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); > > spapr_machine_2_5_class_options(mc); > - mc->alias = NULL; > - mc->is_default = 0; > smc->dr_lmb_enabled = false; > SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_4); > } > > -DEFINE_SPAPR_MACHINE(2_4, "2.4"); > +DEFINE_SPAPR_MACHINE(2_4, "2.4", false); > > /* > * pseries-2.3 > @@ -2396,7 +2396,7 @@ static void spapr_machine_2_3_class_options(MachineClass *mc) > spapr_machine_2_4_class_options(mc); > SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_3); > } > -DEFINE_SPAPR_MACHINE(2_3, "2.3"); > +DEFINE_SPAPR_MACHINE(2_3, "2.3", false); > > /* > * pseries-2.2 > @@ -2421,7 +2421,7 @@ static void spapr_machine_2_2_class_options(MachineClass *mc) > spapr_machine_2_3_class_options(mc); > SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_2); > } > -DEFINE_SPAPR_MACHINE(2_2, "2.2"); > +DEFINE_SPAPR_MACHINE(2_2, "2.2", false); > > /* > * pseries-2.1 > @@ -2440,7 +2440,7 @@ static void spapr_machine_2_1_class_options(MachineClass *mc) > spapr_machine_2_2_class_options(mc); > SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_1); > } > -DEFINE_SPAPR_MACHINE(2_1, "2.1"); > +DEFINE_SPAPR_MACHINE(2_1, "2.1", false); > > static void spapr_machine_register_types(void) > { > Reviewed-by: Alexey Kardashevskiy -- Alexey