From 59ccd20a9ac719cff82180429458728f03ec612f Mon Sep 17 00:00:00 2001 From: KONRAD Frederic Date: Wed, 24 Apr 2013 10:07:56 +0200 Subject: virtio-rng-pci: switch to the new API. Here the virtio-rng-pci is modified for the new API. The device virtio-rng-pci extends virtio-pci. It creates and connects a virtio-rng-device during the init. The properties are not changed. The virtio_pci_reset function, is removed as no longer used. The virtio_pci_rst function, is renamed virtio_pci_reset. Signed-off-by: KONRAD Frederic Tested-by: Cornelia Huck Acked-by: Amit Shah Message-id: 1366790881-3026-4-git-send-email-fred.konrad@greensocs.com Signed-off-by: Anthony Liguori --- hw/virtio/virtio-pci.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'hw/virtio/virtio-pci.h') diff --git a/hw/virtio/virtio-pci.h b/hw/virtio/virtio-pci.h index db0185c3a6..ac718248e1 100644 --- a/hw/virtio/virtio-pci.h +++ b/hw/virtio/virtio-pci.h @@ -38,6 +38,7 @@ typedef struct VirtIOBalloonPCI VirtIOBalloonPCI; typedef struct VirtIOSerialPCI VirtIOSerialPCI; typedef struct VirtIONetPCI VirtIONetPCI; typedef struct VHostSCSIPCI VHostSCSIPCI; +typedef struct VirtIORngPCI VirtIORngPCI; /* virtio-pci-bus */ @@ -87,7 +88,6 @@ struct VirtIOPCIProxy { uint32_t class_code; uint32_t nvectors; uint32_t host_features; - VirtIORNGConf rng; bool ioeventfd_disabled; bool ioeventfd_started; VirtIOIRQFD *vector_irqfd; @@ -188,6 +188,18 @@ typedef struct V9fsPCIState { #endif +/* + * virtio-rng-pci: This extends VirtioPCIProxy. + */ +#define TYPE_VIRTIO_RNG_PCI "virtio-rng-pci" +#define VIRTIO_RNG_PCI(obj) \ + OBJECT_CHECK(VirtIORngPCI, (obj), TYPE_VIRTIO_RNG_PCI) + +struct VirtIORngPCI { + VirtIOPCIProxy parent_obj; + VirtIORNG vdev; +}; + void virtio_init_pci(VirtIOPCIProxy *proxy, VirtIODevice *vdev); void virtio_pci_bus_new(VirtioBusState *bus, VirtIOPCIProxy *dev); -- cgit v1.2.3-55-g7522