diff options
author | Thomas Huth <thuth@redhat.com> | 2019-05-18 10:23:24 +0200 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2019-08-15 19:23:59 +0200 |
commit | 1999a70a05ad603d1c76e0a7d230bcfed0d626ac (patch) | |
tree | 967aed417b9d954d6b7436dc19b2e22dfce8a3b4 /tests/libqos/virtio.h | |
parent | ca1ef1e62e581f61c40f8be49d222007739691c4 (diff) |
tests/libqos: Make generic virtio code independent from global_qtest
The libqos library functions should never depend on global_qtest,
since these functions might be used in tests that track multiple
test states. Pass around a pointer to the QTestState instead.
Message-Id: <20190814195920.32023-1-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/libqos/virtio.h')
-rw-r--r-- | tests/libqos/virtio.h | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/tests/libqos/virtio.h b/tests/libqos/virtio.h index 7b97f5e567..037176dbd8 100644 --- a/tests/libqos/virtio.h +++ b/tests/libqos/virtio.h @@ -114,11 +114,11 @@ void qvirtio_set_driver_ok(QVirtioDevice *d); void qvirtio_wait_queue_isr(QVirtioDevice *d, QVirtQueue *vq, gint64 timeout_us); -uint8_t qvirtio_wait_status_byte_no_isr(QVirtioDevice *d, +uint8_t qvirtio_wait_status_byte_no_isr(QTestState *qts, QVirtioDevice *d, QVirtQueue *vq, uint64_t addr, gint64 timeout_us); -void qvirtio_wait_used_elem(QVirtioDevice *d, +void qvirtio_wait_used_elem(QTestState *qts, QVirtioDevice *d, QVirtQueue *vq, uint32_t desc_idx, uint32_t *len, @@ -131,17 +131,21 @@ void qvirtqueue_cleanup(const QVirtioBus *bus, QVirtQueue *vq, void qvring_init(QTestState *qts, const QGuestAllocator *alloc, QVirtQueue *vq, uint64_t addr); -QVRingIndirectDesc *qvring_indirect_desc_setup(QVirtioDevice *d, - QGuestAllocator *alloc, uint16_t elem); -void qvring_indirect_desc_add(QVRingIndirectDesc *indirect, uint64_t data, - uint32_t len, bool write); -uint32_t qvirtqueue_add(QVirtQueue *vq, uint64_t data, uint32_t len, bool write, - bool next); -uint32_t qvirtqueue_add_indirect(QVirtQueue *vq, QVRingIndirectDesc *indirect); -void qvirtqueue_kick(QVirtioDevice *d, QVirtQueue *vq, uint32_t free_head); -bool qvirtqueue_get_buf(QVirtQueue *vq, uint32_t *desc_idx, uint32_t *len); - -void qvirtqueue_set_used_event(QVirtQueue *vq, uint16_t idx); +QVRingIndirectDesc *qvring_indirect_desc_setup(QTestState *qs, QVirtioDevice *d, + QGuestAllocator *alloc, + uint16_t elem); +void qvring_indirect_desc_add(QTestState *qts, QVRingIndirectDesc *indirect, + uint64_t data, uint32_t len, bool write); +uint32_t qvirtqueue_add(QTestState *qts, QVirtQueue *vq, uint64_t data, + uint32_t len, bool write, bool next); +uint32_t qvirtqueue_add_indirect(QTestState *qts, QVirtQueue *vq, + QVRingIndirectDesc *indirect); +void qvirtqueue_kick(QTestState *qts, QVirtioDevice *d, QVirtQueue *vq, + uint32_t free_head); +bool qvirtqueue_get_buf(QTestState *qts, QVirtQueue *vq, uint32_t *desc_idx, + uint32_t *len); + +void qvirtqueue_set_used_event(QTestState *qts, QVirtQueue *vq, uint16_t idx); void qvirtio_start_device(QVirtioDevice *vdev); |