From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org, "Wanpeng Li" <liwp@linux.vnet.ibm.com>,
"Anthony Liguori" <anthony@codemonkey.ws>,
"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH RFC 0/3] qom: Generalize qdev init to "realize"
Date: Tue, 27 Mar 2012 18:46:06 +0200 [thread overview]
Message-ID: <4F71EECE.6000307@redhat.com> (raw)
In-Reply-To: <CAFEAcA-672g0AmQJSy-2Sfd3roKDNtoDx9xMwcZ-TxMgppir5w@mail.gmail.com>
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
next prev parent reply other threads:[~2012-03-27 16:46 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
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 [this message]
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=4F71EECE.6000307@redhat.com \
--to=pbonzini@redhat.com \
--cc=afaerber@suse.de \
--cc=anthony@codemonkey.ws \
--cc=liwp@linux.vnet.ibm.com \
--cc=peter.maydell@linaro.org \
--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).