aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio-pci.h
diff options
context:
space:
mode:
authorKONRAD Frederic <fred.konrad@greensocs.com>2013-03-18 17:37:23 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2013-03-18 13:08:40 -0500
commit653ced071b061bbd9cc7d03374be93dcefb37910 (patch)
treedf99e2f74dcc8b9f1f0679821fbd666539bf7544 /hw/virtio-pci.h
parent1c028ddfb0c5004c8ec86c96ae09068026e77a38 (diff)
virtio-blk-pci: switch to new API.
Here the virtio-blk-pci is modified for the new API. The device virtio-blk-pci extends virtio-pci. It creates and connects a virtio-blk during the init. The properties are not changed. Signed-off-by: KONRAD Frederic <fred.konrad@greensocs.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1363624648-16906-7-git-send-email-fred.konrad@greensocs.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/virtio-pci.h')
-rw-r--r--hw/virtio-pci.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/hw/virtio-pci.h b/hw/virtio-pci.h
index 2ae96f84d6..a9dbffffea 100644
--- a/hw/virtio-pci.h
+++ b/hw/virtio-pci.h
@@ -25,6 +25,7 @@
#include "hw/9pfs/virtio-9p-device.h"
typedef struct VirtIOPCIProxy VirtIOPCIProxy;
+typedef struct VirtIOBlkPCI VirtIOBlkPCI;
/* virtio-pci-bus */
@@ -73,7 +74,6 @@ struct VirtIOPCIProxy {
uint32_t flags;
uint32_t class_code;
uint32_t nvectors;
- VirtIOBlkConf blk;
NICConf nic;
uint32_t host_features;
#ifdef CONFIG_VIRTFS
@@ -90,6 +90,19 @@ struct VirtIOPCIProxy {
VirtioBusState bus;
};
+/*
+ * virtio-blk-pci: This extends VirtioPCIProxy.
+ */
+#define TYPE_VIRTIO_BLK_PCI "virtio-blk-pci"
+#define VIRTIO_BLK_PCI(obj) \
+ OBJECT_CHECK(VirtIOBlkPCI, (obj), TYPE_VIRTIO_BLK_PCI)
+
+struct VirtIOBlkPCI {
+ VirtIOPCIProxy parent_obj;
+ VirtIOBlock vdev;
+ VirtIOBlkConf blk;
+};
+
void virtio_init_pci(VirtIOPCIProxy *proxy, VirtIODevice *vdev);
void virtio_pci_bus_new(VirtioBusState *bus, VirtIOPCIProxy *dev);