From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Anthony Liguori <anthony@codemonkey.ws>
Subject: Re: [Qemu-devel] [PATCH RFC 3/3] qdev: Hook up DeviceClass::init to ObjectClass::realize
Date: Mon, 26 Mar 2012 15:54:31 +0200 [thread overview]
Message-ID: <4F707517.1060701@suse.de> (raw)
In-Reply-To: <1332769612-4247-4-git-send-email-afaerber@suse.de>
Am 26.03.2012 15:46, schrieb Andreas Färber:
> On realize, call the qdev init function.
> If that returns an error, raise QERR_DEVICE_INIT_FAILED.
Sorry, that sentence is outdated - the error is set in qom/object.c
(patch 1/3) for non-zero return values. It is merely being passed
through here.
Andreas
>
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> Cc: Anthony Liguori <anthony@codemonkey.ws>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> ---
> hw/qdev.c | 13 +++++++++++++
> 1 files changed, 13 insertions(+), 0 deletions(-)
>
> diff --git a/hw/qdev.c b/hw/qdev.c
> index ee21d90..c84b656 100644
> --- a/hw/qdev.c
> +++ b/hw/qdev.c
> @@ -649,6 +649,13 @@ static void device_finalize(Object *obj)
> QTAILQ_REMOVE(&dev->parent_bus->children, dev, sibling);
> }
>
> +static int device_realize(Object *obj)
> +{
> + DeviceState *dev = DEVICE(obj);
> +
> + return qdev_init(dev);
> +}
> +
> void device_reset(DeviceState *dev)
> {
> DeviceClass *klass = DEVICE_GET_CLASS(dev);
[snip]
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2012-03-26 13:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-26 13:46 [Qemu-devel] [PATCH RFC 0/3] qom: Generalize qdev init to "realize" Andreas Färber
2012-03-26 13:46 ` [Qemu-devel] [PATCH RFC 1/3] qom: Add "realized" property to Object Andreas Färber
2012-03-26 15:07 ` Andreas Färber
2012-03-27 9:25 ` Stefan Hajnoczi
2012-03-26 13:46 ` [Qemu-devel] [PATCH RFC 2/3] qom: Introduce object_realize() Andreas Färber
2012-03-26 13:46 ` [Qemu-devel] [PATCH RFC 3/3] qdev: Hook up DeviceClass::init to ObjectClass::realize Andreas Färber
2012-03-26 13:54 ` Andreas Färber [this message]
2012-03-27 16:19 ` [Qemu-devel] [PATCH RFC 0/3] qom: Generalize qdev init to "realize" Paolo Bonzini
2012-03-27 16:28 ` Anthony Liguori
2012-03-27 16:33 ` Peter Maydell
2012-03-27 16:46 ` Paolo Bonzini
2012-03-27 18:56 ` Anthony Liguori
2012-03-27 16:41 ` Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F707517.1060701@suse.de \
--to=afaerber@suse.de \
--cc=anthony@codemonkey.ws \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).