aboutsummaryrefslogtreecommitdiff
path: root/tests/libqos
diff options
context:
space:
mode:
authorEmanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com>2018-07-25 16:25:43 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2019-03-07 16:50:04 +0100
commit34c977489dd85e3528b0e5c3a02157c834560efa (patch)
tree1a70337475f661124498a7a2d668f864507b158e /tests/libqos
parent5b774fe5505dc7daad908f9f4b95e9e735c45c14 (diff)
tests/libqos: introduce virtio_start_device
This function is intended to group all the qvirtio_* functions that start the qvirtio devices. Applied in all tests using this combination of functions. Signed-off-by: Emanuele Giuseppe Esposito <e.emanuelegiuseppe@gmail.com> Reviewed-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tests/libqos')
-rw-r--r--tests/libqos/virtio.c7
-rw-r--r--tests/libqos/virtio.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/tests/libqos/virtio.c b/tests/libqos/virtio.c
index 0dad5c19ac..c1ff0206d5 100644
--- a/tests/libqos/virtio.c
+++ b/tests/libqos/virtio.c
@@ -365,3 +365,10 @@ const char *qvirtio_get_dev_type(void)
return "pci";
}
}
+
+void qvirtio_start_device(QVirtioDevice *vdev)
+{
+ qvirtio_reset(vdev);
+ qvirtio_set_acknowledge(vdev);
+ qvirtio_set_driver(vdev);
+}
diff --git a/tests/libqos/virtio.h b/tests/libqos/virtio.h
index 69b5b13840..2c68668de0 100644
--- a/tests/libqos/virtio.h
+++ b/tests/libqos/virtio.h
@@ -146,5 +146,6 @@ bool qvirtqueue_get_buf(QVirtQueue *vq, uint32_t *desc_idx, uint32_t *len);
void qvirtqueue_set_used_event(QVirtQueue *vq, uint16_t idx);
const char *qvirtio_get_dev_type(void);
+void qvirtio_start_device(QVirtioDevice *vdev);
#endif