From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NFuBy-00079S-J6 for qemu-devel@nongnu.org; Wed, 02 Dec 2009 13:44:46 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NFuBu-00078z-KV for qemu-devel@nongnu.org; Wed, 02 Dec 2009 13:44:46 -0500 Received: from [199.232.76.173] (port=38707 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFuBu-00078u-ES for qemu-devel@nongnu.org; Wed, 02 Dec 2009 13:44:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:28740) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NFuBu-0007Be-01 for qemu-devel@nongnu.org; Wed, 02 Dec 2009 13:44:42 -0500 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nB2Iif9M009540 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 2 Dec 2009 13:44:41 -0500 Date: Wed, 2 Dec 2009 20:42:00 +0200 From: "Michael S. Tsirkin" Message-ID: <20091202184200.GB3984@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: [Qemu-devel] Re: [PATCH 11/41] virtio: Introduce type field to distingish between PCI and Syborg List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu-devel@nongnu.org On Wed, Dec 02, 2009 at 01:04:09PM +0100, Juan Quintela wrote: > > Signed-off-by: Juan Quintela Let's just use binding for this. > --- > hw/syborg_virtio.c | 1 + > hw/virtio-pci.c | 2 +- > hw/virtio.h | 6 ++++++ > 3 files changed, 8 insertions(+), 1 deletions(-) > > diff --git a/hw/syborg_virtio.c b/hw/syborg_virtio.c > index 6cf5a15..46ac192 100644 > --- a/hw/syborg_virtio.c > +++ b/hw/syborg_virtio.c > @@ -275,6 +275,7 @@ static int syborg_virtio_net_init(SysBusDevice *dev) > SyborgVirtIOProxy *proxy = FROM_SYSBUS(SyborgVirtIOProxy, dev); > > vdev = virtio_net_init(&dev->qdev, &proxy->nic); > + vdev->type = VIRTIO_SYBORG; > return syborg_virtio_init(proxy, vdev); > } > > diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c > index 25b6380..a2179de 100644 > --- a/hw/virtio-pci.c > +++ b/hw/virtio-pci.c > @@ -433,7 +433,7 @@ static void virtio_init_pci(VirtIOPCIProxy *proxy, VirtIODevice *vdev, > > pci_register_bar(&proxy->pci_dev, 0, size, PCI_BASE_ADDRESS_SPACE_IO, > virtio_map); > - > + vdev->type = VIRTIO_PCI; > virtio_bind_device(vdev, &virtio_pci_bindings, proxy); > } > > diff --git a/hw/virtio.h b/hw/virtio.h > index 15ad910..ec1ff4d 100644 > --- a/hw/virtio.h > +++ b/hw/virtio.h > @@ -88,6 +88,11 @@ typedef struct { > > #define VIRTIO_NO_VECTOR 0xffff > > +typedef enum VirtIOType { > + VIRTIO_PCI, > + VIRTIO_SYBORG, > +} VirtIOType; > + > struct VirtIODevice > { > const char *name; > @@ -106,6 +111,7 @@ struct VirtIODevice > void (*set_config)(VirtIODevice *vdev, const uint8_t *config); > void (*reset)(VirtIODevice *vdev); > VirtQueue *vq; > + VirtIOType type; > const VirtIOBindings *binding; > void *binding_opaque; > uint16_t device_id; > -- > 1.6.5.2