From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50955) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2JbZ-00046i-63 for qemu-devel@nongnu.org; Tue, 28 Feb 2012 04:44:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S2JbS-0005nA-F3 for qemu-devel@nongnu.org; Tue, 28 Feb 2012 04:44:20 -0500 Received: from plane.gmane.org ([80.91.229.3]:51297) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2JbS-0005mo-8V for qemu-devel@nongnu.org; Tue, 28 Feb 2012 04:44:14 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1S2JbQ-0000Cq-Ib for qemu-devel@nongnu.org; Tue, 28 Feb 2012 10:44:12 +0100 Received: from 213.33.220.118 ([213.33.220.118]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 28 Feb 2012 10:44:12 +0100 Received: from i.mitsyanko by 213.33.220.118 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 28 Feb 2012 10:44:12 +0100 From: Igor Mitsyanko Date: Tue, 28 Feb 2012 13:43:57 +0400 Message-ID: <4F4CA1DD.6080905@samsung.com> References: <1330413510-9289-1-git-send-email-i.mitsyanko@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit In-Reply-To: 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: qemu-devel@nongnu.org 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. > > Paolo > > > Can't understand how type_get_parent() is relevant to this, we can call object_initialize() or object_new_with_type() and these two functions must set instance_size before calling object_initialize_with_type(). Up to this point there are no calls to type_get_parent(). Mitsyanko Igor ASWG, Moscow R&D center, Samsung Electronics email: i.mitsyanko@samsung.com