qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] pc: reduce duplication in compat machine types


From: Avi Kivity
Subject: Re: [Qemu-devel] [PATCH] pc: reduce duplication in compat machine types
Date: Mon, 26 Mar 2012 14:51:38 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120316 Thunderbird/11.0

On 03/26/2012 11:40 AM, Michael S. Tsirkin wrote:
> Make it easier to add compat properties, by
> adding macros for properties duplicated across
> machine types.
>
> Note: there could be bugs in compat properties,
> this patch does not attempt to address them,
> the code is bug for bug identical to the original.
>
> Tested by: generated a preprocessed file, sorted and
> compared to sorted original.
> Lightly tested on x86_64.
>
>  
> +#define PC_COMPAT_1_0 \
> +        {\
> +            .driver   = "pc-sysfw",\
> +            .property = "rom_only",\
> +            .value    = stringify(1),\
> +        }, {\
> +            .driver   = "isa-fdc",\
> +            .property = "check_media_rate",\
> +            .value    = "off",\
> +        }
> +

Hmm.  how about

>  static QEMUMachine pc_machine_v1_0 = {
>      .name = "pc-1.0",
>      .desc = "Standard PC",
>      .init = pc_init_pci,
>      .max_cpus = 255,
>      .compat_props = (GlobalProperty[]) {
> -        {
> -            .driver   = "pc-sysfw",
> -            .property = "rom_only",
> -            .value    = stringify(1),
> -        }, {
> -            .driver   = "isa-fdc",
> -            .property = "check_media_rate",
> -            .value    = "off",
> -        },
> +        PC_COMPAT_1_0,

+    .base_machine =  &pc_machine_v1_1;

Then it would be easier to define machines differentially.


>          { /* end of list */ }
>      },


-- 
error compiling committee.c: too many arguments to function




reply via email to

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