qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Anthony PERARD <anthony.perard@citrix.com>,
	Jan Kiszka <jan.kiszka@siemens.com>,
	Anthony Liguori <aliguori@us.ibm.com>,
	qemu-devel@nongnu.org, Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] [PATCH] pc: reduce duplication in compat machine types
Date: Mon, 26 Mar 2012 14:51:38 +0200	[thread overview]
Message-ID: <4F70665A.9000809@redhat.com> (raw)
In-Reply-To: <20120326094020.GA14437@redhat.com>

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	other threads:[~2012-03-26 12:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-26  9:40 [Qemu-devel] [PATCH] pc: reduce duplication in compat machine types Michael S. Tsirkin
2012-03-26 12:51 ` Avi Kivity [this message]
2012-03-26 13:32   ` Michael S. Tsirkin
2012-03-26 13:12 ` Andreas Färber
2012-03-26 13:23   ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F70665A.9000809@redhat.com \
    --to=avi@redhat.com \
    --cc=agraf@suse.de \
    --cc=aliguori@us.ibm.com \
    --cc=anthony.perard@citrix.com \
    --cc=jan.kiszka@siemens.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).