[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH RFC 0/3] Recursive QOM realize

From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH RFC 0/3] Recursive QOM realize
Date: Mon, 15 Jul 2013 16:43:54 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6

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

     ,------'  |   '------.
/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?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]