From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCZXZ-0004f2-37 for qemu-devel@nongnu.org; Tue, 27 Mar 2012 12:46:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SCZXU-0004lH-EP for qemu-devel@nongnu.org; Tue, 27 Mar 2012 12:46:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55748) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCZXU-0004kd-2w for qemu-devel@nongnu.org; Tue, 27 Mar 2012 12:46:32 -0400 Message-ID: <4F71EECE.6000307@redhat.com> Date: Tue, 27 Mar 2012 18:46:06 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1332769612-4247-1-git-send-email-afaerber@suse.de> <4F71E8AE.9030504@redhat.com> <4F71EABB.1030004@codemonkey.ws> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH RFC 0/3] qom: Generalize qdev init to "realize" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org, Wanpeng Li , Anthony Liguori , =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= Il 27/03/2012 18:33, Peter Maydell ha scritto: >> > Yes, I haven't reviewed this series yet, but my expectation would be that >> > realize propagates and that the default implementation of >> > DeviceClass::realize() would explicitly *not* propagate and instead just >> > call ::init. > So who calls realize for non-qdev QOM objects which are children of > qdev QOM objects? > > I really don't like having the object lifecycle methods be different > for DeviceClass than for base objects if we can avoid it. The way I read it was that the "realize" property propagates to the children and calls either the "realize" or "reset" method (in the appropriate order). DeviceClass::realize() would also do other things done currently by qdev_init, such as register vmstate, so there would still be a separation between DeviceClass::realize and DeviceClass::init (we do not want yet another pass through the whole tree). qdev_init would be a thin wrapper around object_realize that takes care of freeing the object when init fails. Is this correct? Paolo