From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36113) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Turmk-0002GR-6H for qemu-devel@nongnu.org; Mon, 14 Jan 2013 16:41:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Turmh-00086V-Ts for qemu-devel@nongnu.org; Mon, 14 Jan 2013 16:41:38 -0500 Received: from greensocs.com ([87.106.252.221]:59398 helo=s15328186.onlinehome-server.info) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Turmh-00086H-OA for qemu-devel@nongnu.org; Mon, 14 Jan 2013 16:41:35 -0500 Message-ID: <50F47B8A.8010402@greensocs.com> Date: Mon, 14 Jan 2013 22:41:30 +0100 From: =?ISO-8859-1?Q?KONRAD_Fr=E9d=E9ric?= MIME-Version: 1.0 References: <1357747019-20580-1-git-send-email-fred.konrad@greensocs.com> <1357747019-20580-5-git-send-email-fred.konrad@greensocs.com> <87bocrwpjr.fsf@codemonkey.ws> <50F46C44.9080406@greensocs.com> <50F47B25.8020203@suse.de> In-Reply-To: <50F47B25.8020203@suse.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH V2 4/7] virtio-pci-bus: introduce virtio-pci-bus. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-1?Q?Andreas_F=E4rber?= Cc: kwolf@redhat.com, peter.maydell@linaro.org, Anthony Liguori , e.voevodin@samsung.com, mst@redhat.com, mark.burton@greensocs.com, qemu-devel@nongnu.org, agraf@suse.de, amit.shah@redhat.com, aneesh.kumar@linux.vnet.ibm.com, stefanha@redhat.com, cornelia.huck@de.ibm.com, pbonzini@redhat.com On 14/01/2013 22:39, Andreas F=E4rber wrote: > Am 14.01.2013 21:36, schrieb KONRAD Fr=E9d=E9ric: >> On 14/01/2013 20:08, Anthony Liguori wrote: >>> fred.konrad@greensocs.com writes: >>> >>>> +VirtioBusState *virtio_pci_bus_new(VirtIOPCIProxy *dev) >>>> +{ >>>> + DeviceState *qdev =3D DEVICE(dev); >>>> + BusState *qbus =3D qbus_create(TYPE_VIRTIO_PCI_BUS, qdev, NULL)= ; >>>> + VirtioBusState *bus =3D VIRTIO_BUS(qbus); >>>> + qbus->allow_hotplug =3D 0; >>> Any reason to not use a qbus_create_inplace()? >>> >>> Regards, >>> >>> Anthony Liguori >> If I change the bus field of VirtIOPCIProxy from VirtioBus* to VirtioB= us >> and I use qbus_create_inplace >> I can't use qbus_create_inplace(BUS(&dev->bus),...) as the object is n= ot >> initialised yet right? > Correct, you need to use qbus_create_inplace((BusState *)&dev->bus,...)= . > I ran into the same trap for ADB last night. ;) > > Andreas > ok, so I'll use the cast. I suppose it is the same for the s390. Thanks Andreas! Fred