From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35116) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2Kvu-00037R-KY for qemu-devel@nongnu.org; Tue, 28 Feb 2012 06:09:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S2Kvr-00045o-L0 for qemu-devel@nongnu.org; Tue, 28 Feb 2012 06:09:26 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:54230) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2Kvr-00045T-FA for qemu-devel@nongnu.org; Tue, 28 Feb 2012 06:09:23 -0500 Received: from euspt2 (mailout2.w1.samsung.com [210.118.77.12]) by mailout2.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTP id <0M03003NIOBK3G@mailout2.w1.samsung.com> for qemu-devel@nongnu.org; Tue, 28 Feb 2012 11:09:20 +0000 (GMT) Received: from [106.109.8.162] by spt2.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0M03001BYOBJR4@spt2.w1.samsung.com> for qemu-devel@nongnu.org; Tue, 28 Feb 2012 11:09:19 +0000 (GMT) Date: Tue, 28 Feb 2012 15:09:07 +0400 From: Igor Mitsyanko In-reply-to: <4F4CA68D.8050800@redhat.com> Message-id: <4F4CB5D3.7060703@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-15; format=flowed Content-transfer-encoding: 7BIT References: <1330413510-9289-1-git-send-email-i.mitsyanko@samsung.com> <4F4CA1DD.6080905@samsung.com> <4F4CA68D.8050800@redhat.com> Subject: Re: [Qemu-devel] [PATCH] qom: if @instance_size==0, assign size of object to parent object size Reply-To: i.mitsyanko@samsung.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On 02/28/2012 02:03 PM, Paolo Bonzini wrote: > Il 28/02/2012 10:43, Igor Mitsyanko ha scritto: >> On 02/28/2012 12:39 PM, Paolo Bonzini wrote: >>> Il 28/02/2012 08:18, Igor Mitsyanko ha scritto: >>>> QOM documentation states that for objects of type with @instance_size >>>> == 0 size >>>> will be assigned to match parent object's size. But currently this >>>> feauture is >>>> not implemented and qemu asserts during creation of object with zero >>>> instance_size. >>>> This patch adjusts actual behaviour in accordance with documentation. >>> >>> You can do it just once, in type_get_parent instead. > > Sorry, rewind. "You can do it in type_class_init instead" (you are > obviously doing it just once since you assign to type->instance_size). > type_class_init mostly deals with class initialization, but it's really > the place where a type is hooked up with its parent... Ok, that's obviously a much better approach. Perhaps > type_late_init would be a better name. How about simple type_initialization()? -- Mitsyanko Igor ASWG, Moscow R&D center, Samsung Electronics email: i.mitsyanko@samsung.com