From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tgdjj-0002op-Gr for qemu-devel@nongnu.org; Thu, 06 Dec 2012 10:51:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tgdjb-0000ER-NS for qemu-devel@nongnu.org; Thu, 06 Dec 2012 10:51:43 -0500 Received: from cantor2.suse.de ([195.135.220.15]:36581 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tgdjb-0000EL-Gg for qemu-devel@nongnu.org; Thu, 06 Dec 2012 10:51:35 -0500 Message-ID: <50C0BF03.90206@suse.de> Date: Thu, 06 Dec 2012 16:51:31 +0100 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 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> In-Reply-To: <20121206152933.GG4986@otherpad.lan.raisama.net> Content-Type: text/plain; charset=ISO-8859-1 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: Eduardo Habkost Cc: Peter Maydell , Paolo Bonzini , qemu-devel@nongnu.org, Anthony Liguori , rth@twiddle.net 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(), here. I still don't understand why. (CC'ing Anthony, Paolo, Peter) 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 IMO. Is there a reason to do it differently? What would we want to do with TypeInfo after transfer of its field values to TypeImpl? FWIW if, as suggested earlier, we don't loop over Alpha CPU models in favor of a handful of trivial static TypeInfos, it becomes irrelevant for this patch but I'd still like to understand for the remaining architectures. Regards, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg