From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53311) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkfNT-0003ro-Ih for qemu-devel@nongnu.org; Mon, 17 Dec 2012 13:25:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TkfNS-00073i-I7 for qemu-devel@nongnu.org; Mon, 17 Dec 2012 13:25:23 -0500 Received: from cantor2.suse.de ([195.135.220.15]:41272 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkfNS-00073a-BI for qemu-devel@nongnu.org; Mon, 17 Dec 2012 13:25:22 -0500 Message-ID: <50CF6384.9040809@suse.de> Date: Mon, 17 Dec 2012 19:25:08 +0100 From: =?ISO-8859-1?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <20121217154521.GA28674@redhat.com> <50CF5CA2.7060800@suse.de> <50CF629A.4090005@redhat.com> In-Reply-To: <50CF629A.4090005@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] virtio: make bindings typesafe List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Anthony Liguori , "Michael S. Tsirkin" , Jan Kiszka , Alexander Graf , qemu-devel@nongnu.org, Christian Borntraeger , fred.konrad@greensocs.com Am 17.12.2012 19:21, schrieb Paolo Bonzini: > Il 17/12/2012 18:55, Andreas F=E4rber ha scritto: >> Am 17.12.2012 16:45, schrieb Michael S. Tsirkin: >>> diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c >>> index 3ea4140..63ae888 100644 >>> --- a/hw/virtio-pci.c >>> +++ b/hw/virtio-pci.c >>> @@ -98,34 +98,34 @@ bool virtio_is_big_endian(void); >>> =20 >>> /* virtio device */ >>> =20 >>> -static void virtio_pci_notify(void *opaque, uint16_t vector) >>> +static void virtio_pci_notify(DeviceState *d, uint16_t vector) >>> { >>> - VirtIOPCIProxy *proxy =3D opaque; >>> + VirtIOPCIProxy *proxy =3D container_of(d, VirtIOPCIProxy, pci_de= v.qdev); >> >> Nack. This is going the wrong direction QOM-wise and you among all >> others know that from PCI host bridges! >=20 > Well, that's just a difference of VIRTIO_PCI_PROXY(d) vs. container_of. VIRTIO_PCI_PROXY(d) would be acceptable, sure. But as-is this patch just pushes unnecessary work on Fred, me, you or anyone else who works with QO= M. Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg