qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 11/41] virtio: Introduce type field to distingish be


From: Juan Quintela
Subject: [Qemu-devel] [PATCH 11/41] virtio: Introduce type field to distingish between PCI and Syborg
Date: Wed, 2 Dec 2009 13:04:09 +0100

Signed-off-by: Juan Quintela <address@hidden>
---
 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]