qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/2] hw/ppc/spapr: Create pseries-2.6 machine


From: Alexander Graf
Subject: Re: [Qemu-devel] [PATCH 1/2] hw/ppc/spapr: Create pseries-2.6 machine
Date: Fri, 27 Nov 2015 10:55:06 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.3.0


On 27.11.15 10:32, Thomas Huth wrote:
> Add a new pseries-2.6 machine class version to make sure we can
> keep the old types compatible to previous versions of QEMU in
> later patches.
> 
> Signed-off-by: Thomas Huth <address@hidden>
> ---
>  hw/ppc/spapr.c | 21 +++++++++++++++++++--
>  1 file changed, 19 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 6bfb908..10b7c35 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -2439,8 +2439,6 @@ static void spapr_machine_2_5_class_init(ObjectClass 
> *oc, void *data)
>  
>      mc->name = "pseries-2.5";
>      mc->desc = "pSeries Logical Partition (PAPR compliant) v2.5";
> -    mc->alias = "pseries";
> -    mc->is_default = 1;
>      smc->dr_lmb_enabled = true;
>  }
>  
> @@ -2450,6 +2448,24 @@ static const TypeInfo spapr_machine_2_5_info = {
>      .class_init    = spapr_machine_2_5_class_init,
>  };
>  
> +static void spapr_machine_2_6_class_init(ObjectClass *oc, void *data)
> +{
> +    MachineClass *mc = MACHINE_CLASS(oc);
> +    sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(oc);
> +
> +    mc->name = "pseries-2.6";
> +    mc->desc = "pSeries Logical Partition (PAPR compliant) v2.6";
> +    mc->alias = "pseries";
> +    mc->is_default = 1;
> +    smc->dr_lmb_enabled = true;

We should probably start to follow a scheme similar to x86 where the new
machine initialization calls its predecessor (2.5 in this case) to
ensure we don't forget feature flags and quirks.

So you can either directly call spapr_machine_2_5_class_init() from
spapr_machine_2_6_class_init() or extract the quirk part
(dr_lmb_enabled) into a function that gets marked as "from 2.5 on" in
its function name and call it from 2_5_class_init and from a "from 2.6
on" function that gets called from 2_6_class_init.


Alex



reply via email to

[Prev in Thread] Current Thread [Next in Thread]