From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:54822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QoMX5-0001w3-PY for qemu-devel@nongnu.org; Tue, 02 Aug 2011 17:29:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QoMX4-0004hu-JW for qemu-devel@nongnu.org; Tue, 02 Aug 2011 17:29:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8108) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QoMX4-0004hl-BE for qemu-devel@nongnu.org; Tue, 02 Aug 2011 17:29:46 -0400 Message-ID: <4E386C44.607@redhat.com> Date: Wed, 03 Aug 2011 00:29:40 +0300 From: Avi Kivity MIME-Version: 1.0 References: <4E381EA7.2070809@redhat.com> <4E383CE5.4010405@siemens.com> <4E3866DA.2050608@codemonkey.ws> In-Reply-To: <4E3866DA.2050608@codemonkey.ws> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] modelling omap_gpmc with the hierarchical memory API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Jan Kiszka , QEMU Developers , Peter Maydell On 08/03/2011 12:06 AM, Anthony Liguori wrote: > > The qdev level should be the common base that makes sense for *all* > qdev devices. IRQ management does not belong in DeviceState because > what you do for a simple LCD is not what you do for an MSI-X capable > PCI device. > > This is what QOM properties tries to address. It should be possible > to create a simple device, and register plugs/sockets for GPIO pins > without pushing GPIO knowledge into the base class. > > In a QDev world, the right approach is to have a GpioDevice base class > that implements this sort of logic for devices where it makes sense. > That's what SysBusDevice sort of wants to be but it somehow ended up > as yet another base class for everything. > Doesn't this end up requiring multiple inheritance, and a ton of boilerplate in addition? I'm in favour of throwing everything into qdev so it's easy to use. If a device doesn't have gpio, why, 0 is a valid integer. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.