From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tiqza-0003MJ-MA for qemu-devel@nongnu.org; Wed, 12 Dec 2012 13:25:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TiqzQ-00065V-Ll for qemu-devel@nongnu.org; Wed, 12 Dec 2012 13:25:14 -0500 Received: from cantor2.suse.de ([195.135.220.15]:50690 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiqzQ-00063V-G9 for qemu-devel@nongnu.org; Wed, 12 Dec 2012 13:25:04 -0500 Message-ID: <50C8CBFD.3030905@suse.de> Date: Wed, 12 Dec 2012 19:25:01 +0100 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1353888766-6951-1-git-send-email-afaerber@suse.de> <1353888766-6951-5-git-send-email-afaerber@suse.de> <20121212142905.GA5334@otherpad.lan.raisama.net> <50C8B606.4000102@suse.de> <20121212181633.GH3236@otherpad.lan.raisama.net> In-Reply-To: <20121212181633.GH3236@otherpad.lan.raisama.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC 04/34] qdev: Prepare "realized" property List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: Paolo Bonzini , qemu-devel@nongnu.org, anthony@codemonkey.ws Am 12.12.2012 19:16, schrieb Eduardo Habkost: > So, just to check if I understood all correctly: >=20 > DeviceClass.init() is just the old and deprecated version of > DeviceClass.realize() (just because the former has no Error parameter), > but both have exactly the same semantics/purpose, and devices should no= w > use DeviceClass.realize() instead. Correct? Almost! Some qdev initfns today do things that instance_init should do and realizefn shouldn't. Creating child devices in qdev initfn tampers with our future ability to set realized =3D true recursively. The other difference that I see (RFC) is that qdev uses an only-the-instance's-class-sets-init approach, whereas with QOM any class in the hierarchy can set/override the "virtual" method but needs to take care of storing and (if desired) calling the parent's version itself, i.e. an inversion of control towards child classes. 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