From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53800) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTUrl-0001OI-Ue for qemu-devel@nongnu.org; Thu, 24 Nov 2011 03:41:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RTUrg-0000LB-GO for qemu-devel@nongnu.org; Thu, 24 Nov 2011 03:41:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45147) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RTUrg-0000Kr-9L for qemu-devel@nongnu.org; Thu, 24 Nov 2011 03:41:04 -0500 Message-ID: <4ECE0319.6020202@redhat.com> Date: Thu, 24 Nov 2011 10:40:57 +0200 From: Avi Kivity MIME-Version: 1.0 References: <1321994102-28263-1-git-send-email-benoit.canet@gmail.com> <1321994102-28263-8-git-send-email-benoit.canet@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 07/11] bonito: convert north bridge register mapping to memory API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: =?UTF-8?B?QmVub8OudCBDYW5ldA==?= , qemu-devel@nongnu.org On 11/23/2011 01:03 AM, Peter Maydell wrote: > 2011/11/22 Beno=C3=AEt Canet : > > static int bonito_initfn(PCIDevice *dev) > > { > > PCIBonitoState *s =3D DO_UPCAST(PCIBonitoState, dev, dev); > > + SysBusDevice *sysbus =3D sysbus_from_qdev(&dev->qdev); > > This looks odd. The device here is a PCIBonitoState, which > is-a PCIDevice, which is-a DeviceState. It's not a SysBusDevice > and merely casting doesn't make it one. > > I'm not sure what should be being done here, but I'm pretty > sure this won't work... s->pcihost.busdev gives you a SysBusDevice (and s->pcihost.confmem/datamem gives you a few MemoryRegions that you need later in bonito_initfn. --=20 error compiling committee.c: too many arguments to function