aboutsummaryrefslogtreecommitdiff
path: root/tests/libqos/virtio-pci.h
diff options
context:
space:
mode:
authorEmanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>2018-07-18 16:02:41 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2019-03-07 17:28:26 +0100
commit1ce66ecec0f26ea6a3b450c66bde6fe171471f1c (patch)
treec368bf4cf1b2fde100eef1433d5d4db1705b3e5e /tests/libqos/virtio-pci.h
parentb026393c34779578106d3cc889271b1757b8d287 (diff)
tests/libqos: virtio-pci driver and interface nodes
Add QOSGraphObject to QVirtioPCIDevice structure, with a basic constructor. virtio-pci is not present in qgraph, since it will be used as starting point by its subclasses (virtio-*-pci) Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tests/libqos/virtio-pci.h')
-rw-r--r--tests/libqos/virtio-pci.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/libqos/virtio-pci.h b/tests/libqos/virtio-pci.h
index 6ef19094cb..56313527a7 100644
--- a/tests/libqos/virtio-pci.h
+++ b/tests/libqos/virtio-pci.h
@@ -12,8 +12,10 @@
#include "libqos/virtio.h"
#include "libqos/pci.h"
+#include "libqos/qgraph.h"
typedef struct QVirtioPCIDevice {
+ QOSGraphObject obj;
QVirtioDevice vdev;
QPCIDevice *pdev;
QPCIBar bar;
@@ -31,11 +33,23 @@ typedef struct QVirtQueuePCI {
extern const QVirtioBus qvirtio_pci;
+void virtio_pci_init(QVirtioPCIDevice *dev, QPCIBus *bus, QPCIAddress * addr);
+QVirtioPCIDevice *virtio_pci_new(QPCIBus *bus, QPCIAddress * addr);
QVirtioPCIDevice *qvirtio_pci_device_find(QPCIBus *bus, uint16_t device_type);
QVirtioPCIDevice *qvirtio_pci_device_find_slot(QPCIBus *bus,
uint16_t device_type, int slot);
void qvirtio_pci_device_free(QVirtioPCIDevice *dev);
+/* virtio-pci object functions available for subclasses that
+ * override the original start_hw and destroy
+ * function. All virtio-xxx-pci subclass that override must
+ * take care of calling these two functions in the respective
+ * places
+ */
+void qvirtio_pci_destructor(QOSGraphObject *obj);
+void qvirtio_pci_start_hw(QOSGraphObject *obj);
+
+
void qvirtio_pci_device_enable(QVirtioPCIDevice *d);
void qvirtio_pci_device_disable(QVirtioPCIDevice *d);