diff mbox series

[1/5] tests/libqos: mask out VIRTIO_F_RING_PACKED for now

Message ID 20200522171726.648279-2-stefanha@redhat.com (mailing list archive)
State New, archived
Headers show
Series virtio: enable VIRTIO_F_RING_PACKED for all devices | expand

Commit Message

Stefan Hajnoczi May 22, 2020, 5:17 p.m. UTC
The libqos VIRTIO code does not implement the packed virtqueue layout
yet. Mask out the feature bit for now because tests have a habit of
enabling all device feature bits and we don't want packed virtqueues to
be enabled.

Later patches will enable VIRTIO_F_RING_PACKED so prepare libqos now.

Cc: Thomas Huth <thuth@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 tests/qtest/libqos/virtio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Thomas Huth May 22, 2020, 7:21 p.m. UTC | #1
> From: "Stefan Hajnoczi" <stefanha@redhat.com>
> Sent: Friday, May 22, 2020 7:17:22 PM
> 
> The libqos VIRTIO code does not implement the packed virtqueue layout
> yet. Mask out the feature bit for now because tests have a habit of
> enabling all device feature

Sounds like we should rather fix these tests in the long run - they
should really only enable the bits that they support...

> bits and we don't want packed virtqueues to
> be enabled.
> 
> Later patches will enable VIRTIO_F_RING_PACKED so prepare libqos now.
> 
> Cc: Thomas Huth <thuth@redhat.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>  tests/qtest/libqos/virtio.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/qtest/libqos/virtio.c b/tests/qtest/libqos/virtio.c
> index 9aa360620c..1c3f4a0c8b 100644
> --- a/tests/qtest/libqos/virtio.c
> +++ b/tests/qtest/libqos/virtio.c
> @@ -96,7 +96,8 @@ uint64_t qvirtio_config_readq(QVirtioDevice *d, uint64_t
> addr)
>  
>  uint64_t qvirtio_get_features(QVirtioDevice *d)
>  {
> -    return d->bus->get_features(d);
> +    /* qvirtio does not support packed virtqueues yet */
> +    return d->bus->get_features(d) & ~(1ull << VIRTIO_F_RING_PACKED);
>  }

... but as a temporary work-around, that should be fine, too.
(in case you respin, maybe add a TODO comment here, too, to remind us to fix
the tests later).

Acked-by: Thomas Huth <thuth@redhat.com>
diff mbox series

Patch

diff --git a/tests/qtest/libqos/virtio.c b/tests/qtest/libqos/virtio.c
index 9aa360620c..1c3f4a0c8b 100644
--- a/tests/qtest/libqos/virtio.c
+++ b/tests/qtest/libqos/virtio.c
@@ -96,7 +96,8 @@  uint64_t qvirtio_config_readq(QVirtioDevice *d, uint64_t addr)
 
 uint64_t qvirtio_get_features(QVirtioDevice *d)
 {
-    return d->bus->get_features(d);
+    /* qvirtio does not support packed virtqueues yet */
+    return d->bus->get_features(d) & ~(1ull << VIRTIO_F_RING_PACKED);
 }
 
 void qvirtio_set_features(QVirtioDevice *d, uint64_t features)