Received: from eggs.gnu.org ([208.118.235.92]:45621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsD6C-0004wX-1U for qemu-devel@nongnu.org; Mon, 07 Jan 2013 08:50:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TsD6A-0002In-Fu for qemu-devel@nongnu.org; Mon, 07 Jan 2013 08:50:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:14138) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsD6A-0002Ia-7G for qemu-devel@nongnu.org; Mon, 07 Jan 2013 08:50:42 -0500 Date: Mon, 7 Jan 2013 11:52:01 -0200 From: Eduardo Habkost Message-ID: <20130107135201.GE26746@otherpad.lan.raisama.net> References: <1357498122-1129-1-git-send-email-afaerber@suse.de> <1357498122-1129-3-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1357498122-1129-3-git-send-email-afaerber@suse.de> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 2/2] qdev: Prepare "realized" property List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, anthony@codemonkey.ws On Sun, Jan 06, 2013 at 07:48:42PM +0100, Andreas F=E4rber wrote: > Based on earlier patches by Paolo and me, introduce the QOM realizefn a= t > device level only, as requested by Anthony. >=20 > For now this just wraps the qdev initfn, which it deprecates. >=20 > Signed-off-by: Paolo Bonzini > Signed-off-by: Andreas F=E4rber > Cc: Anthony Liguori > --- > hw/qdev-core.h | 4 +++ > hw/qdev.c | 96 ++++++++++++++++++++++++++++++++++++++++++------= -------- > 2 Dateien ge=E4ndert, 76 Zeilen hinzugef=FCgt(+), 24 Zeilen entfernt(-= ) >=20 > diff --git a/hw/qdev-core.h b/hw/qdev-core.h > index 5836e35..e50c866 100644 > --- a/hw/qdev-core.h > +++ b/hw/qdev-core.h > @@ -20,6 +20,8 @@ enum { > typedef int (*qdev_initfn)(DeviceState *dev); > typedef int (*qdev_event)(DeviceState *dev); > typedef void (*qdev_resetfn)(DeviceState *dev); > +typedef void (*DeviceRealize)(DeviceState *dev, Error **err); > +typedef void (*DeviceUnrealize)(DeviceState *dev, Error **err); > =20 > struct VMStateDescription; > =20 > @@ -38,6 +40,8 @@ typedef struct DeviceClass { > const struct VMStateDescription *vmsd; > =20 > /* Private to qdev / bus. */ > + DeviceRealize realize; > + DeviceUnrealize unrealize; > qdev_initfn init; Can we get the semantics of the realize/unrealize/init functions documented here? For example, explicitly document that subclasses are supposed to call the parent's realize function (this is the case, right?), and the differences between DeviceState.init and DeviceState.realize. I took some time to understand the reason for DeviceState.realize to exist when we already have DeviceState.init, and I am sure I already forgot half of the explanation, and I will forget it completely in 1 or 2 months. :-) > [...] --=20 Eduardo