|
From: | Anthony Liguori |
Subject: | Re: [Qemu-devel] [RFC] Plan for moving forward with QOM |
Date: | Thu, 15 Sep 2011 11:33:00 -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 10:38 AM, Gleb Natapov wrote:
On Thu, Sep 15, 2011 at 10:28:52AM -0500, Anthony Liguori wrote:On 09/15/2011 09:25 AM, Gleb Natapov wrote: 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.Yes, "canonical" is a link to a bus. Can you give an example of a device that sits on multiple buses?
Not all devices buses that they sit on.A good example is our favorite one to debate--the PIIX3. Devices like the UART don't sit on a bus. They don't have any links at all.
Instead, the PIIX3 itself bridges the public interface of the UART via its PC interface. So it looks something like this:
class Serial : public Device { uint8_t read(uint8_t addr); }; class PIIX3 : public PciDevice, implements PciBus { Serial *tty[4]; }; uint32_t PIIX3::pio_access(uint16_t addr, int size) { if (addr == 0x3f8 && this->tty[0]) { return this->tty[0]->read(addr - 0x3f8); } else { ... } }There is no backlink in the Serial device so there's no way of walking up the graph from the Serial device itself. You have to transverse to it to build a path.
Regards, Anthony Liguori
-- Gleb.
[Prev in Thread] | Current Thread | [Next in Thread] |