Commit 1ee0bc0c9bf0 removed vhost_dev.backend_features and its
representation in VhostStatus. It also removed the assignment to
VirtioStatus.backend_features, although both that field and its source,
VirtIODevice.backend_features_ex, still exist.
The resulting NULL pointer causes HMP info virtio-status and QMP
x-query-virtio-status to crash. This affects virtio devices even without
an active vhost backend.
Restore the assignment from VirtIODevice.backend_features_ex and
enable corresponding test, which becomes fixed.
Fixes: 1ee0bc0c9bf0 ("vhost: drop backend_features field")
Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
---
hw/virtio/virtio-qmp.c | 2 ++
tests/functional/x86_64/test_virtio_status.py | 1 -
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/virtio/virtio-qmp.c b/hw/virtio/virtio-qmp.c
index 5aaeebdd96a..8b7cd7a3106 100644
--- a/hw/virtio/virtio-qmp.c
+++ b/hw/virtio/virtio-qmp.c
@@ -713,6 +713,8 @@ VirtioStatus *qmp_x_query_virtio_status(const char *path,
Error **errp)
vdev->guest_features_ex);
status->host_features = qmp_decode_features(vdev->device_id,
vdev->host_features_ex);
+ status->backend_features = qmp_decode_features(vdev->device_id,
+ vdev->backend_features_ex);
switch (vdev->device_endian) {
case VIRTIO_DEVICE_ENDIAN_LITTLE:
diff --git a/tests/functional/x86_64/test_virtio_status.py
b/tests/functional/x86_64/test_virtio_status.py
index c8cbdf7c42e..1e72c713cc6 100755
--- a/tests/functional/x86_64/test_virtio_status.py
+++ b/tests/functional/x86_64/test_virtio_status.py
@@ -84,7 +84,6 @@ def test_vhost(self):
self.check_commands(vm)
- @skipIfMissingEnv("QEMU_FAILING_TESTS")
def test_no_vhost(self):
self.vm.add_args("-accel", "kvm",
"-S", "-net", "none", "-device",
--
2.43.0