From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:57865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4FBV-0001TJ-H2 for qemu-devel@nongnu.org; Thu, 15 Sep 2011 12:53:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R4FBU-0005ag-Jm for qemu-devel@nongnu.org; Thu, 15 Sep 2011 12:53:09 -0400 Received: from e33.co.us.ibm.com ([32.97.110.151]:58813) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4Esk-0001kb-TT for qemu-devel@nongnu.org; Thu, 15 Sep 2011 12:33:47 -0400 Received: from /spool/local by us.ibm.com with XMail ESMTP for from ; Thu, 15 Sep 2011 10:33:44 -0600 Received: from d03av06.boulder.ibm.com (d03av06.boulder.ibm.com [9.17.195.245]) by d03relay05.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p8FGX23K079186 for ; Thu, 15 Sep 2011 10:33:02 -0600 Received: from d03av06.boulder.ibm.com (loopback [127.0.0.1]) by d03av06.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p8FGctTd003596 for ; Thu, 15 Sep 2011 10:38:55 -0600 Message-ID: <4E7228BC.9030104@us.ibm.com> Date: Thu, 15 Sep 2011 11:33:00 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <4E70EC90.8000904@us.ibm.com> <20110915063121.GW21417@redhat.com> <4E720435.3060509@codemonkey.ws> <4E720855.1090501@redhat.com> <20110915142534.GC11524@redhat.com> <4E7219B4.9050109@us.ibm.com> <20110915153838.GE11524@redhat.com> In-Reply-To: <20110915153838.GE11524@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC] Plan for moving forward with QOM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gleb Natapov Cc: Peter Maydell , Jan Kiszka , qemu-devel , Markus Armbruster , Gerd Hoffmann , "Edgar E. Iglesias" , Paolo Bonzini 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.