From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59342) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SC9Oo-0005zs-N7 for qemu-devel@nongnu.org; Mon, 26 Mar 2012 08:51:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SC9Oi-0002HT-IZ for qemu-devel@nongnu.org; Mon, 26 Mar 2012 08:51:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10610) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SC9Oi-0002HD-AN for qemu-devel@nongnu.org; Mon, 26 Mar 2012 08:51:44 -0400 Message-ID: <4F70665A.9000809@redhat.com> Date: Mon, 26 Mar 2012 14:51:38 +0200 From: Avi Kivity MIME-Version: 1.0 References: <20120326094020.GA14437@redhat.com> In-Reply-To: <20120326094020.GA14437@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] pc: reduce duplication in compat machine types List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Anthony PERARD , Jan Kiszka , Anthony Liguori , qemu-devel@nongnu.org, Alexander Graf 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