diff options
author | KONRAD Frederic <fred.konrad@greensocs.com> | 2013-04-24 10:07:56 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-04-24 11:50:19 -0500 |
commit | 59ccd20a9ac719cff82180429458728f03ec612f (patch) | |
tree | ad1d80917cee18600cb02d190cd7db5f554e3cef /hw/virtio/virtio-pci.h | |
parent | 6eac8aec02b1e9c5a626820bcca7654cb7d006a7 (diff) |
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 <fred.konrad@greensocs.com>
Tested-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Amit Shah <amit.shah@redhat.com>
Message-id: 1366790881-3026-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 | 14 |
1 files changed, 13 insertions, 1 deletions
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); |