hw/virtio/vdpa-dev: pass set_config buffer to vhost backend
vhost_vdpa_device_set_config() receives the updated config buffer, but forwards s->config to the vhost backend. Since s->config is refreshed by get_config(), it may contain stale backend state. Pass the supplied config buffer to vhost_dev_set_config() instead. Fixes: b430a2bd2303 ("vdpa: add vdpa-dev support") Signed-off-by: GuoHan Zhao <zhaoguohan@kylinos.cn> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-ID: <20260709073225.2341642-1-zhaoguohan@kylinos.cn>
GuoHan Zhao committed
Jul 9, 2026 at 15:32 UTC
421f45d03f328267ebf77fab823a7a25ab3d6c83
1 file changed
+1
-1
hw/virtio/vdpa-dev.c
+1
-1
@@ -212,7 +212,7 @@ vhost_vdpa_device_set_config(VirtIODevice *vdev, const uint8_t *config)
212
VhostVdpaDevice *s = VHOST_VDPA_DEVICE(vdev);
213
int ret;
214
215
- ret = vhost_dev_set_config(&s->dev, s->config, 0, s->config_size,
215
+ ret = vhost_dev_set_config(&s->dev, config, 0, s->config_size,
216
VHOST_SET_CONFIG_TYPE_FRONTEND);
217
if (ret) {
218
error_report("set device config space failed");