diff options
author | KONRAD Frederic <fred.konrad@greensocs.com> | 2013-04-11 16:29:58 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-04-17 10:28:58 -0500 |
commit | e37da3945fa2fde161e1b217f937fc318c4b7639 (patch) | |
tree | 6275c35b6942eda2171acee123b6e9fdd4a73d12 /hw/virtio/virtio-pci.h | |
parent | 17ec5a8686143da66208273d355f2eeb09807614 (diff) |
virtio-net-pci: switch to the new API.
Here the virtio-net-pci is modified for the new API. The device
virtio-net-pci extends virtio-pci. It creates and connects a
virtio-net-device during the init. The properties are not changed.
Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com>
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Message-id: 1365690602-22729-4-git-send-email-fred.konrad@greensocs.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/virtio/virtio-pci.h')
-rw-r--r-- | hw/virtio/virtio-pci.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/hw/virtio/virtio-pci.h b/hw/virtio/virtio-pci.h index 879cc83582..aa67561c04 100644 --- a/hw/virtio/virtio-pci.h +++ b/hw/virtio/virtio-pci.h @@ -30,6 +30,7 @@ typedef struct VirtIOBlkPCI VirtIOBlkPCI; typedef struct VirtIOSCSIPCI VirtIOSCSIPCI; typedef struct VirtIOBalloonPCI VirtIOBalloonPCI; typedef struct VirtIOSerialPCI VirtIOSerialPCI; +typedef struct VirtIONetPCI VirtIONetPCI; /* virtio-pci-bus */ @@ -78,12 +79,10 @@ struct VirtIOPCIProxy { uint32_t flags; uint32_t class_code; uint32_t nvectors; - NICConf nic; uint32_t host_features; #ifdef CONFIG_VIRTFS V9fsConf fsconf; #endif - virtio_net_conf net; VirtIORNGConf rng; bool ioeventfd_disabled; bool ioeventfd_started; @@ -142,6 +141,18 @@ struct VirtIOSerialPCI { VirtIOSerial vdev; }; +/* + * virtio-net-pci: This extends VirtioPCIProxy. + */ +#define TYPE_VIRTIO_NET_PCI "virtio-net-pci" +#define VIRTIO_NET_PCI(obj) \ + OBJECT_CHECK(VirtIONetPCI, (obj), TYPE_VIRTIO_NET_PCI) + +struct VirtIONetPCI { + VirtIOPCIProxy parent_obj; + VirtIONet vdev; +}; + void virtio_init_pci(VirtIOPCIProxy *proxy, VirtIODevice *vdev); void virtio_pci_bus_new(VirtioBusState *bus, VirtIOPCIProxy *dev); |