[Top][All Lists]

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

Re: [Qemu-devel] [RFC] Plan for moving forward with QOM

From: Anthony Liguori
Subject: Re: [Qemu-devel] [RFC] Plan for moving forward with QOM
Date: Thu, 15 Sep 2011 10:28:52 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110516 Lightning/1.0b2 Thunderbird/3.1.10

On 09/15/2011 09:25 AM, Gleb Natapov wrote:
On Thu, Sep 15, 2011 at 04:14:45PM +0200, Paolo Bonzini wrote:
On 09/15/2011 03:57 PM, Anthony Liguori wrote:

void generate_tree(Device *node)
    if (IS_PCI_BUS(node)) {
       for (i = 0; i<  32; i++) {
          generate_tree(lookup_device(get_property(node, "slot[%d]", i)));
    } else if (IS_ISA_BUS(node)) {
    } else {
       // leaf node, generate path segment

There are certainly ways to walk the graph generically (by coloring or
following the composition paths) but that won't give you the desired

It seems easier to go backwards from the target device.
That what we do in qdev.

Each device most likely will have a canonical parent link, and
together they will give the OF path.

Yeah, this canonical parent link should be marked somehow.

There is no canonical parent link. A device may have multiple (more or less equivalent) parents.

What should be treated as the "canonical" link depends on what you're trying to do. In the case of OF, you want to treat the bus as a parent. If a device happens to sit on multiple buses, I'm not really sure what you do.


Anthony Liguori


reply via email to

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