[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH 11/41] virtio: Introduce type field to distingis
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] Re: [PATCH 11/41] virtio: Introduce type field to distingish between PCI and Syborg |
Date: |
Wed, 2 Dec 2009 20:42:00 +0200 |
User-agent: |
Mutt/1.5.19 (2009-01-05) |
On Wed, Dec 02, 2009 at 01:04:09PM +0100, Juan Quintela wrote:
>
> Signed-off-by: Juan Quintela <address@hidden>
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
- [Qemu-devel] Re: [PATCH 06/41] virtio: Use DO_UPCAST instead of a cast, (continued)
- [Qemu-devel] Re: [PATCH 06/41] virtio: Use DO_UPCAST instead of a cast, Michael S. Tsirkin, 2009/12/03
- [Qemu-devel] Re: [PATCH 06/41] virtio: Use DO_UPCAST instead of a cast, Juan Quintela, 2009/12/03
- [Qemu-devel] Re: [PATCH 06/41] virtio: Use DO_UPCAST instead of a cast, Michael S. Tsirkin, 2009/12/03
- [Qemu-devel] Re: [PATCH 06/41] virtio: Use DO_UPCAST instead of a cast, Juan Quintela, 2009/12/03
- Re: [Qemu-devel] Re: [PATCH 06/41] virtio: Use DO_UPCAST instead of a cast, Avi Kivity, 2009/12/03
[Qemu-devel] [PATCH 08/41] msix: Store sizes that we send/receive, Juan Quintela, 2009/12/02
[Qemu-devel] [PATCH 09/41] msix: port to vmstate, Juan Quintela, 2009/12/02
[Qemu-devel] [PATCH 10/41] qemu/pci: document msix_entries_nr field, Juan Quintela, 2009/12/02
[Qemu-devel] [PATCH 11/41] virtio: Introduce type field to distingish between PCI and Syborg, Juan Quintela, 2009/12/02
- [Qemu-devel] Re: [PATCH 11/41] virtio: Introduce type field to distingish between PCI and Syborg,
Michael S. Tsirkin <=
[Qemu-devel] [PATCH 12/41] virtio-pci: port pci config to vmstate, Juan Quintela, 2009/12/02
[Qemu-devel] [PATCH 13/41] msix: msix_load/save are not needed anymore, Juan Quintela, 2009/12/02
[Qemu-devel] [PATCH 14/41] virtio: remove save/load_config for virtio, Juan Quintela, 2009/12/02
[Qemu-devel] [PATCH 15/41] virtio: remove save/load_queue for virtio, Juan Quintela, 2009/12/02