[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 4/5] hw/virtio: ensure a valid host_feature set for virtio-use
From: |
Alex Bennée |
Subject: |
[PATCH v2 4/5] hw/virtio: ensure a valid host_feature set for virtio-user-gpio |
Date: |
Fri, 25 Nov 2022 17:30:42 +0000 |
There was a disconnect here because vdev->host_features was set to
random rubbish. This caused a weird negotiation between the driver and
device that took no account of the features provided by the backend.
To fix this we must set vdev->host_features once we have initialised
the vhost backend.
[AJB: however this is confusing because AFAICT none of the other
vhost-user devices do this.]
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
hw/virtio/vhost-user-gpio.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/virtio/vhost-user-gpio.c b/hw/virtio/vhost-user-gpio.c
index 5851cb3bc9..b2496c824c 100644
--- a/hw/virtio/vhost-user-gpio.c
+++ b/hw/virtio/vhost-user-gpio.c
@@ -228,6 +228,12 @@ static int vu_gpio_connect(DeviceState *dev, Error **errp)
return ret;
}
+ /*
+ * Once we have initialised the vhost backend we can finally set
+ * the what host features are available for this device.
+ */
+ vdev->host_features = vhost_dev->features;
+
/* restore vhost state */
if (virtio_device_started(vdev, vdev->status)) {
vu_gpio_start(vdev);
--
2.34.1
- [PATCH for 7.2-rc? v2 0/5] continuing efforts to fix vhost-user issues, Alex Bennée, 2022/11/25
- [PATCH v2 1/5] include/hw: attempt to document VirtIO feature variables, Alex Bennée, 2022/11/25
- [PATCH v2 2/5] include/hw: VM state takes precedence in virtio_device_should_start, Alex Bennée, 2022/11/25
- [PATCH v2 4/5] hw/virtio: ensure a valid host_feature set for virtio-user-gpio,
Alex Bennée <=
- [PATCH v2 3/5] tests/qtests: override "force-legacy" for gpio virtio-mmio tests, Alex Bennée, 2022/11/25
- [PATCH v2 5/5] vhost: enable vrings in vhost_dev_start() for vhost-user devices, Alex Bennée, 2022/11/25
- Re: [PATCH for 7.2-rc? v2 0/5] continuing efforts to fix vhost-user issues, Stefan Weil, 2022/11/25
- Re: [PATCH for 7.2-rc? v2 0/5] continuing efforts to fix vhost-user issues, Alex Bennée, 2022/11/25