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>
This commit is contained in:
KONRAD Frederic 2013-04-11 16:29:58 +02:00 committed by Anthony Liguori
parent 17ec5a8686
commit e37da3945f
2 changed files with 69 additions and 60 deletions

View file

@ -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);