From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46601) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCA22-0004Lb-Vg for qemu-devel@nongnu.org; Mon, 26 Mar 2012 09:32:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SCA1w-0007Hj-O8 for qemu-devel@nongnu.org; Mon, 26 Mar 2012 09:32:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34271) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCA1w-0007HS-GR for qemu-devel@nongnu.org; Mon, 26 Mar 2012 09:32:16 -0400 Date: Mon, 26 Mar 2012 15:32:22 +0200 From: "Michael S. Tsirkin" Message-ID: <20120326133221.GB16511@redhat.com> References: <20120326094020.GA14437@redhat.com> <4F70665A.9000809@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F70665A.9000809@redhat.com> 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: Avi Kivity Cc: Anthony PERARD , Jan Kiszka , Anthony Liguori , qemu-devel@nongnu.org, Alexander Graf On Mon, Mar 26, 2012 at 02:51:38PM +0200, Avi Kivity wrote: > 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; > It's a lot of work, and the result won't be easier to modify or debug than it already is, IMO. > Then it would be easier to define machines differentially. We add new 1 machine each release, so I'm not worried about adding them easily, adding properies easily happens between releases so I want to make is simpler. > > { /* end of list */ } > > }, > > -- > error compiling committee.c: too many arguments to function