From: Paolo Bonzini <pbonzini@redhat.com>
To: "Andreas Färber" <afaerber@suse.de>
Cc: Blue Swirl <blauwirbel@gmail.com>, Hu Tao <hutao@cn.fujitsu.com>,
"Peter C. Crosthwaite" <peter.crosthwaite@xilinx.com>,
qemu-devel@nongnu.org, Anthony Liguori <anthony@codemonkey.ws>
Subject: Re: [Qemu-devel] [PATCH RFC 0/3] Recursive QOM realize
Date: Mon, 15 Jul 2013 16:43:54 +0200 [thread overview]
Message-ID: <51E40AAA.2010500@redhat.com> (raw)
In-Reply-To: <1373895639-21476-1-git-send-email-afaerber@suse.de>
Il 15/07/2013 15:40, Andreas Färber ha scritto:
> Originally Paolo and me had implemented QOM realize at Object level.
> Paolo's goal was to set realized = true on /machine and it propagating from
> there on. This series now implements {realize,unrealize}_children at
> DeviceState level instead and propagates realized changes along busses rather
> than child<> properties.
You are right that realize must be done after the bus is realized (and
unrealize must be done before the bus). But I'm afraid this opens a can
of worms.
> On machine creation done, a depth-first search is done
> for devices from /machine, which are then expected to further propagate the
> property change.
How do you ensure that devices are realized before their bus's parent
_and_ before their parent? With two constraints for each device, we
have a graph, not anymore a tree. Example:
(1) this is the composition tree
/machine
,------' | '------.
/pci-host /isa /superio
,----' '----.
/i8254 /i8259
(2) this is the bus tree
PCI (/pci-host)
|
ISA (/isa)
,-----------' '------.
/superio/i8254 /superio/i8259
The constraints are:
- pci-host before isa
- superio before superio/i8254
- superio before superio/i8259
- isa before superio/i8254
- isa before superio/i8259
So the two valid orders are
- /machine, pci-host, superio, isa, superio/i8254, superio/8259
- /machine, pci-host, isa, superio, superio/i8254, superio/8259
You cannot say whether superio or isa are encountered first, so you
cannot say whether it is superio or isa that should "hold off" the visit
of their children (in either the QOM tree or the bus tree). What avoids
us having to do a full topological ordering of the graph?
Paolo
next prev parent reply other threads:[~2013-07-15 14:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-15 13:40 [Qemu-devel] [PATCH RFC 0/3] Recursive QOM realize Andreas Färber
2013-07-15 13:40 ` [Qemu-devel] [PATCH RFC 1/3] qdev: Add support for recursive realization Andreas Färber
2013-07-15 13:40 ` [Qemu-devel] [PATCH RFC 2/3] qdev: Realize on machine creation done Andreas Färber
2013-07-15 13:40 ` [Qemu-devel] [PATCH RFC 3/3] qdev: Assert no new devices get created during realization Andreas Färber
2013-07-15 14:43 ` Paolo Bonzini [this message]
2013-07-15 15:06 ` [Qemu-devel] [PATCH RFC 0/3] Recursive QOM realize Andreas Färber
2013-07-15 15:37 ` Paolo Bonzini
2013-07-16 12:19 ` Andreas Färber
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=51E40AAA.2010500@redhat.com \
--to=pbonzini@redhat.com \
--cc=afaerber@suse.de \
--cc=anthony@codemonkey.ws \
--cc=blauwirbel@gmail.com \
--cc=hutao@cn.fujitsu.com \
--cc=peter.crosthwaite@xilinx.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).