qemu-devel
[Top][All Lists]
Advanced

[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 08:57:09 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Lightning/1.0b2 Thunderbird/3.1.10

On 09/15/2011 01:31 AM, Gleb Natapov wrote:
On Wed, Sep 14, 2011 at 01:04:00PM -0500, Anthony Liguori wrote:
All device relationships are identified as named properties.  A QOM
path name
consists of a named device, followed by a series of properties which
may or may
not refer to other devices.  For instance, all of the following are
valid paths:

  /i440fx/piix3/i8042/aux
  /i440fx/slot[1.0]/i8042/aux
  /i440fx/slot[1.0]/bus/piix3/i8042/aux

Have you looked at device paths generated by get_fw_dev_path() in qdev?
This function generates Open Firmware device path. The difference
between OF device path and the examples above is that OF device path has
a meaning outside of QEMU and can be used by firmware to find a device
a path refers too. Will QOM be able to generate them?

The paths look like:
/address@hidden/address@hidden,1/address@hidden/address@hidden
/address@hidden/address@hidden/address@hidden/address@hidden
/address@hidden/address@hidden/address@hidden/address@hidden
/address@hidden/address@hidden,1/address@hidden/address@hidden
/address@hidden/address@hidden,1/address@hidden/address@hidden
/address@hidden/address@hidden/address@hidden,0
/address@hidden/address@hidden/address@hidden
/address@hidden/address@hidden/address@hidden
/address@hidden/address@hidden,1/address@hidden/address@hidden
/address@hidden/address@hidden/address@hidden/address@hidden/address@hidden
/address@hidden/address@hidden,2/address@hidden/address@hidden
/address@hidden/address@hidden,2/address@hidden/address@hidden/address@hidden
/address@hidden/linuxboot.bin

For isa machines:
/isa/address@hidden/address@hidden/address@hidden
/isa/address@hidden/address@hidden
/isa/address@hidden/address@hidden
/isa/address@hidden/address@hidden/address@hidden

A critical point that I neglected to previously mention is that while qdev has a canonical path (only one path, really) to address a device, QOM does not. That means a different approach is needed to make the graph look like a tree as OF requires.

You need something like this:

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 ordering.

Regards,

Anthony Liguori
}



--
                        Gleb.





reply via email to

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