From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:33795) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3vys-00053C-V0 for qemu-devel@nongnu.org; Wed, 14 Sep 2011 16:22:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R3vyr-0000t8-J7 for qemu-devel@nongnu.org; Wed, 14 Sep 2011 16:22:50 -0400 Received: from e39.co.us.ibm.com ([32.97.110.160]:46492) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3vyr-0000rb-Df for qemu-devel@nongnu.org; Wed, 14 Sep 2011 16:22:49 -0400 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by e39.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id p8EK7722024508 for ; Wed, 14 Sep 2011 14:07:07 -0600 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p8EKMWWY175464 for ; Wed, 14 Sep 2011 14:22:36 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p8EKM6UP016362 for ; Wed, 14 Sep 2011 14:22:07 -0600 Message-ID: <4E710D05.6030008@us.ibm.com> Date: Wed, 14 Sep 2011 15:22:29 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <4E70EC90.8000904@us.ibm.com> <20110914200009.GB17136@zapo> In-Reply-To: <20110914200009.GB17136@zapo> 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: "Edgar E. Iglesias" Cc: Peter Maydell , Jan Kiszka , qemu-devel , Markus Armbruster , Gerd Hoffmann On 09/14/2011 03:00 PM, Edgar E. Iglesias wrote: > On Wed, Sep 14, 2011 at 01:04:00PM -0500, Anthony Liguori wrote: >> Hi, >> >> I spent a couple hours today writing up some comparisons and an >> initial task list for converting qdev to QOM. The main location of >> this is the wiki[1] but I thought I would inline it here for easier >> commenting. >> >> I decided to do this because I wanted to avoid a massively long 00 >> patch explaining the rationale for the first batch of changes that >> I'm going to send out. >> >> There is so much complexity in qdev and the device model in general >> that it's hard to come up with a concise document. I'd really >> appreciate suggestions for topics to write up more rationale as that >> would help me avoid writing a book on the topic :-) > > Thanks Anthony, > > I'd appreciate if you could elaborate more on the backlinks. Also, > tiny code examples would help. Maybe you've got a git repo with > more code to link to? Message-Id: <1311558293-5855-1-git-send-email-aliguori@us.ibm.com> Or http://repo.or.cz/w/qemu/aliguori.git/shortlog/refs/heads/qom > > Regarding the composition, a problem I face (which I mostly just > hack my way around) is that inter device connections may exist > at various layers at the same time. For example, a device that is > burried under a couple of busses/bridges may somehow be tighly > connected to another device at a very different location in > the bus hierarchy by means of another overlayed interconnect (e.g > data channels, timing generation, IRQs etc). Maybe you could > clarify a bit more on how QOM handles these topics. Links are meant to handle this. You can have something like: + PlatformDevice1 + PlatformDevice2 + PciBus | +- PciDevice1 +- PciDevice2 | + I2CBus | +- I2CDevice1 |- pd2: link So you have I2CDevice that sites behind multiple levels of hierarchy, but has a direct relationship (via a link) to a platform device much higher in the hierarchy. This is an simple demonstration of how you can create a graph in QOM. qdev doesn't allow graphs in the object model which is the problem that you're having today. That's because its a tree with alternating levels. The top level is always a bus, the next level is always devices, the next level are always busses, etc. With QOM, there are only devices, and devices can link to 0 or more other devices. Regards, Anthony Liguori > > Cheers