From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MEKTu-0005UA-GU for qemu-devel@nongnu.org; Wed, 10 Jun 2009 05:52:30 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MEKTp-0005PY-NK for qemu-devel@nongnu.org; Wed, 10 Jun 2009 05:52:29 -0400 Received: from [199.232.76.173] (port=41468 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MEKTp-0005PR-GJ for qemu-devel@nongnu.org; Wed, 10 Jun 2009 05:52:25 -0400 Received: from mx2.redhat.com ([66.187.237.31]:39278) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MEKTo-0001nC-U5 for qemu-devel@nongnu.org; Wed, 10 Jun 2009 05:52:25 -0400 Message-ID: <4A2F81DA.4070108@redhat.com> Date: Wed, 10 Jun 2009 11:50:18 +0200 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/3] qdev-ify isa pic References: <1244545261-23679-1-git-send-email-kraxel@redhat.com> <200906091632.19195.paul@codesourcery.com> <4A2E84F8.7020303@redhat.com> <200906091658.15889.paul@codesourcery.com> <4A2F61AA.3020502@redhat.com> <5b31733c0906100243q13ef6181h160b7e88c2106194@mail.gmail.com> In-Reply-To: <5b31733c0906100243q13ef6181h160b7e88c2106194@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Filip Navara Cc: Paul Brook , qemu-devel@nongnu.org On 06/10/09 11:43, Filip Navara wrote: > On Wed, Jun 10, 2009 at 9:32 AM, Gerd Hoffmann wrote: > [snip]> >> In general I think we should handle as much as possible at DeviceState / >> DeviceInfo level. Stuff which devices commonly have should live there: >> IRQs, mmio, ioports, ... in DeviceState. name, init and other generic >> callbacks, ... in DeviceInfo. >> >> The bus structs should only hold stuff which is actually specific to that >> bus. That is probably almost nothing for sysbus. i2c has the xfer >> callbacks in I2CSlaveInfo. Likewise pci can have the config space >> read/write callbacks in PCIDeviceInfo. > > This is definitely based on wrong assumptions. I've GPIO devices > modelled on top of qdev and they don't know anything about IRQs, MMIO > or stuff like that. All they know about is that there are few in/out > GPIO pins, which are connected to the GPIO controller in the emulated > microcontroller. Sure, not every device has IRQs. Nevertheless almost every bus out there supports IRQs. Thus it is IMHO pointless to have a common thing duplicated in each end every bus implementation, it should be in the most basic type instead. That of course doesn't imply that every device must actually use them. cheers, Gerd