Received: from eggs.gnu.org ([208.118.235.92]:43642) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tgdzh-0000Uf-Rn for qemu-devel@nongnu.org; Thu, 06 Dec 2012 11:08:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tgdzc-0004mX-0h for qemu-devel@nongnu.org; Thu, 06 Dec 2012 11:08:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:13125) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tgdzb-0004mR-OO for qemu-devel@nongnu.org; Thu, 06 Dec 2012 11:08:07 -0500 Date: Thu, 6 Dec 2012 14:09:38 -0200 From: Eduardo Habkost Message-ID: <20121206160938.GT4255@otherpad.lan.raisama.net> References: <1351652644-18687-1-git-send-email-afaerber@suse.de> <1351652644-18687-3-git-send-email-afaerber@suse.de> <20121206152933.GG4986@otherpad.lan.raisama.net> <50C0BF03.90206@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <50C0BF03.90206@suse.de> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 2/7] target-alpha: Turn CPU definitions into subclasses List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: Peter Maydell , Paolo Bonzini , qemu-devel@nongnu.org, Anthony Liguori , rth@twiddle.net On Thu, Dec 06, 2012 at 04:51:31PM +0100, Andreas F=E4rber wrote: > Am 06.12.2012 16:29, schrieb Eduardo Habkost: > > On Wed, Oct 31, 2012 at 04:03:59AM +0100, Andreas F=E4rber wrote: > > [...] > >> +static void alpha_cpu_register(const AlphaCPUInfo *info) > >> +{ > >> + TypeInfo type_info =3D { > >> + .name =3D info->name, > >> + .parent =3D TYPE_ALPHA_CPU, > >> + .instance_init =3D info->initfn, > >> + }; > >> + > >> + type_register_static(&type_info); > >=20 > > You should use type_register() instead of type_register_static(), her= e. >=20 > I still don't understand why. (CC'ing Anthony, Paolo, Peter) >=20 > The TypeInfo argument is in no way retained inside > qom/object.c:type_register_internal(). > Therefore the lifetime of TypeInfo should be completely irrelevant for > the static/non-static decision and the documentation should be fixed IM= O. > Is there a reason to do it differently? What would we want to do with > TypeInfo after transfer of its field values to TypeImpl? The current implementation doesn't matter. It can change at any minute. T= he interface, on the other hand, is documented as: type_register_static: @info: The #TypeInfo of the new type. @info and all of the strings it points to should exist for the life tim= e that the type is registered. --=20 Eduardo