[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 18/21] tests/qtest: add assert to catch bad features
From: |
Alex Bennée |
Subject: |
[PATCH v3 18/21] tests/qtest: add assert to catch bad features |
Date: |
Tue, 26 Jul 2022 20:21:47 +0100 |
No device driver (which is what the qvirtio_ access functions
represent) should be setting UNUSED(30) in the feature space. Although
existing libqos users mask it out lets ensure nothing sneaks through.
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
tests/qtest/libqos/virtio.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tests/qtest/libqos/virtio.c b/tests/qtest/libqos/virtio.c
index 09ec09b655..03056e5187 100644
--- a/tests/qtest/libqos/virtio.c
+++ b/tests/qtest/libqos/virtio.c
@@ -101,6 +101,8 @@ uint64_t qvirtio_get_features(QVirtioDevice *d)
void qvirtio_set_features(QVirtioDevice *d, uint64_t features)
{
+ g_assert(!(features & QVIRTIO_F_BAD_FEATURE));
+
d->features = features;
d->bus->set_features(d, features);
--
2.30.2
- [PATCH v3 09/21] hw/virtio: fix vhost_user_read tracepoint, (continued)
- [PATCH v3 09/21] hw/virtio: fix vhost_user_read tracepoint, Alex Bennée, 2022/07/26
- [PATCH v3 17/21] tests/qtest: plain g_assert for VHOST_USER_F_PROTOCOL_FEATURES, Alex Bennée, 2022/07/26
- [PATCH v3 21/21] tests/qtest: enable tests for virtio-gpio, Alex Bennée, 2022/07/26
- [PATCH v3 19/21] tests/qtest: implement stub for VHOST_USER_GET_CONFIG, Alex Bennée, 2022/07/26
- [PATCH v3 13/21] tests/qtest: pass stdout/stderr down to subtests, Alex Bennée, 2022/07/26
- [PATCH v3 16/21] tests/qtest: catch unhandled vhost-user messages, Alex Bennée, 2022/07/26
- [PATCH v3 12/21] hw/virtio: add vhost-user-gpio-pci boilerplate, Alex Bennée, 2022/07/26
- [PATCH v3 10/21] hw/virtio: add some vhost-user trace events, Alex Bennée, 2022/07/26
- [PATCH v3 11/21] hw/virtio: add boilerplate for vhost-user-gpio device, Alex Bennée, 2022/07/26
- [PATCH v3 18/21] tests/qtest: add assert to catch bad features,
Alex Bennée <=
- [PATCH v3 14/21] tests/qtest: add a timeout for subprocess_run_one_test, Alex Bennée, 2022/07/26
- Re: [PATCH v3 for 7.2 00/21] virtio-gpio and various virtio cleanups, Michael S. Tsirkin, 2022/07/26