From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MEKLR-0000qM-7N for qemu-devel@nongnu.org; Wed, 10 Jun 2009 05:43:45 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MEKLM-0000pn-TT for qemu-devel@nongnu.org; Wed, 10 Jun 2009 05:43:44 -0400 Received: from [199.232.76.173] (port=47892 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MEKLM-0000pk-LV for qemu-devel@nongnu.org; Wed, 10 Jun 2009 05:43:40 -0400 Received: from mail-ew0-f213.google.com ([209.85.219.213]:56656) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MEKLM-0000We-9k for qemu-devel@nongnu.org; Wed, 10 Jun 2009 05:43:40 -0400 Received: by ewy9 with SMTP id 9so639298ewy.34 for ; Wed, 10 Jun 2009 02:43:38 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4A2F61AA.3020502@redhat.com> 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> Date: Wed, 10 Jun 2009 11:43:38 +0200 Message-ID: <5b31733c0906100243q13ef6181h160b7e88c2106194@mail.gmail.com> Subject: Re: [Qemu-devel] [PATCH 1/3] qdev-ify isa pic From: Filip Navara Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Paul Brook , qemu-devel@nongnu.org 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. =A0Stuff which devices commonly have should live there: > =A0IRQs, mmio, ioports, ... in DeviceState. =A0name, init and other gener= ic > callbacks, ... in DeviceInfo. > > The bus structs should only hold stuff which is actually specific to that > bus. =A0That is probably almost nothing for sysbus. =A0i2c has the xfer > callbacks in I2CSlaveInfo. =A0Likewise 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. Best regards, Filip Navara