Received: from eggs.gnu.org ([2001:4830:134:3::10]:34267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wzc3o-0003NM-JA for qemu-devel@nongnu.org; Tue, 24 Jun 2014 21:31:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wzc3i-0007ti-CY for qemu-devel@nongnu.org; Tue, 24 Jun 2014 21:31:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1197) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wzc3i-0007t3-4n for qemu-devel@nongnu.org; Tue, 24 Jun 2014 21:31:34 -0400 Date: Tue, 24 Jun 2014 22:31:24 -0300 From: Eduardo Habkost Message-ID: <20140625013124.GB14901@otherpad.lan.raisama.net> References: <1403108034-32054-1-git-send-email-mst@redhat.com> <1403108034-32054-27-git-send-email-mst@redhat.com> <20140624164431.GA14901@otherpad.lan.raisama.net> <20140624175520.GU3222@otherpad.lan.raisama.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140624175520.GU3222@otherpad.lan.raisama.net> Subject: Re: [Qemu-devel] per-machine vs per-qemu-version compat_props macros (was Re: acpi:ich9: add memory hotplug handling) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Liu Ping Fan , "Michael S. Tsirkin" , Alexey Kardashevskiy , Marcel Apfelbaum , Markus Armbruster , QEMU Developers , Paul Mackerras , Anthony Liguori , Paolo Bonzini , Igor Mammedov , Andreas =?iso-8859-1?Q?F=E4rber?= , Alexander Graf On Tue, Jun 24, 2014 at 02:55:20PM -0300, Eduardo Habkost wrote: > On Tue, Jun 24, 2014 at 05:47:53PM +0100, Peter Maydell wrote: > > On 24 June 2014 17:44, Eduardo Habkost wrote: > > > (I would go even further and say that no compat_props bit need to be > > > specific to a machine-type family, and they are simply tied to the code > > > included in a QEMU version. So every PC_COMPAT_* bit could go to a > > > common QEMU_COMPAT_ macro, that could be reusable by all > > > machine-types, and there's no need PC-specific compat macros.) > > > > What if different machines in a particular release had the > > property set to different defaults? > > I never saw that happen, and I don't think it is even likely: default > values set in instance_init, and compat_props are applied just after > instance_init, before object_new() returns. So a machine-type would need > to find a way to change fields after instance_init but before > compat_props are applied. > > Anyway, if a machine-type really needs that, it can still have its own > set of compat macros to implement machine-type-specific compat_props. My > point is that there's no need for that on the PC code today. I just found a potential counter-example: the hpet.hpet-intcap compat property. The current hpet.hpet-intcap=0x4 compat property on q35 can (should?) be applied to both piix and q35 machine-types, because 0x4 was the default for both machine-types when the hpet-intcap property was introduced. But now the machine-type initialization code for piix and q35 emulate different defaults by checking if the property is set to zero (which is the actual default on the hpet code). So, if one day we decide to change the hpet-intcap default on piix or q35, we will need different compat_props on each one. But by now we can still keep the code simple and have a single set of compat macros for both. -- Eduardo