From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34722) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SekoI-0003kS-L2 for qemu-devel@nongnu.org; Wed, 13 Jun 2012 06:28:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SekoG-0001kn-K0 for qemu-devel@nongnu.org; Wed, 13 Jun 2012 06:28:22 -0400 Received: from cantor2.suse.de ([195.135.220.15]:37407 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SekoG-0001ka-AH for qemu-devel@nongnu.org; Wed, 13 Jun 2012 06:28:20 -0400 Message-ID: <4FD86B35.90000@suse.de> Date: Wed, 13 Jun 2012 12:28:05 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <76ad34dd30a83d96a97bc7443245ee9c165e053f.1339578989.git.peter.crosthwaite@petalogix.com> <4FD8658C.700@redhat.com> In-Reply-To: <4FD8658C.700@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC v0 5/8] object: make interfaces concrete List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , "Peter A. G. Crosthwaite" Cc: peter.maydell@linaro.org, aliguori@us.ibm.com, qemu-devel@nongnu.org, paul@codesourcery.com, edgar.iglesias@gmail.com, john.williams@petalogix.com, avi@redhat.com Am 13.06.2012 12:03, schrieb Paolo Bonzini: > Il 13/06/2012 11:38, Peter A. G. Crosthwaite ha scritto: >> Objects that define interface delegate the creation of the interface o= bject >> to the interface type. These means that object_new() when called recur= sively by I am pretty certain that object_new() is NOT called recursively! The static helpers of object_instantiate() are, and abstractness should not matter there or none of the, e.g., CPU subclasses could be created... So if there is a problem this description is bogus. >> the interface instantior is going to bork because its trying to instan= tiate >> an abstract type. Fixed by making interface types concrete. >> >> Signed-off-by: Peter A. G. Crosthwaite >> --- >> qom/object.c | 2 +- >> 1 files changed, 1 insertions(+), 1 deletions(-) >> >> diff --git a/qom/object.c b/qom/object.c >> index 1eba795..c3a7a47 100644 >> --- a/qom/object.c >> +++ b/qom/object.c >> @@ -191,7 +191,7 @@ static void type_class_interface_init(TypeImpl *ti= , InterfaceImpl *iface) >> .parent =3D iface->parent, >> .class_size =3D sizeof(InterfaceClass), >> .class_init =3D iface->interface_initfn, >> - .abstract =3D true, >> + .abstract =3D false, >> }; >> char *name =3D g_strdup_printf("<%s::%s>", ti->name, iface->paren= t); >> =20 >> >=20 > Reviewed-by: Paolo Bonzini Why? Object is abstract, too, and in patch 3/8 a type is being derived from TYPE_INTERFACE. So if we want to make interface non-abstract then we don't need the Container type either since it is simply the non-abstract version of Object. My guess is that, if at all, something else is going wrong and this is papering over it. 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