qemu/hw/virtio
Matias Ezequiel Vara Larsen e87b6efb11 vhost-user-snd: correct the calculation of config_size
Use virtio_get_config_size() rather than sizeof(struct
virtio_snd_config) for the config_size in the vhost-user-snd frontend.
The frontend shall rely on device features for the size of the device
configuration space. The presence of `controls` in the config space
depends on VIRTIO_SND_F_CTLS according to the specification (v1.3):
`
5.14.4 Device Configuration Layout
...

controls
(driver-read-only) indicates a total number of all available control
elements if VIRTIO_SND_F_CTLS has been negotiated.
`
This fixes an issue introduced by commit ab0c7fb2 ("linux-headers:
update to current kvm/next") in which the optional field `controls` is
added to the virtio_snd_config structure. This breaks vhost-user-device
backends that do not implement the `controls` field.

Fixes: ab0c7fb22b ("linux-headers: update to current kvm/next")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2805
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Suggested-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Matias Ezequiel Vara Larsen <mvaralar@redhat.com>
Message-Id: <20250217131255.829892-1-mvaralar@redhat.com>
Cc: qemu-stable@nongnu.org
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Dorinda Bassey <dbassey@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2025-02-21 07:21:25 -05:00
..
cbor-helpers.c device/virtio-nsm: Support for Nitro Secure Module device 2024-10-31 18:28:32 +01:00
Kconfig s390x/virtio-ccw: add support for virtio based memory devices 2024-12-21 15:59:59 +01:00
meson.build device/virtio-nsm: Support for Nitro Secure Module device 2024-10-31 18:28:32 +01:00
trace-events virtio-iommu: Add trace point on virtio_iommu_detach_endpoint_from_domain 2024-07-22 20:15:42 -04:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
vdpa-dev-pci.c hw/virtio: Remove empty Property lists 2024-12-19 19:33:37 +01:00
vdpa-dev.c Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
vhost-backend.c vhost: Add worker backend callouts 2023-12-25 11:34:55 -05:00
vhost-iova-tree.c vhost-iova-tree: Update documentation 2025-02-21 07:18:42 -05:00
vhost-iova-tree.h vhost-iova-tree, svq: Implement GPA->IOVA & partial IOVA->HVA trees 2025-02-21 07:18:42 -05:00
vhost-scsi-pci.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
vhost-shadow-virtqueue.c vdpa: Fix endian bugs in shadow virtqueue 2025-02-21 07:18:42 -05:00
vhost-shadow-virtqueue.h vhost-iova-tree, svq: Implement GPA->IOVA & partial IOVA->HVA trees 2025-02-21 07:18:42 -05:00
vhost-stub.c vhost: Add vhost_get_max_memslots() 2023-10-12 14:15:22 +02:00
vhost-user-base.c hw/virtio: Free vqs after vhost_dev_cleanup() 2024-07-01 17:16:05 -04:00
vhost-user-blk-pci.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
vhost-user-device-pci.c virtio: split into vhost-user-base and vhost-user-device 2024-02-14 06:01:39 -05:00
vhost-user-device.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
vhost-user-fs-pci.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
vhost-user-fs.c Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
vhost-user-gpio-pci.c hw/virtio: add vhost-user-gpio-pci boilerplate 2022-10-07 09:41:51 -04:00
vhost-user-gpio.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
vhost-user-i2c-pci.c hw/virtio: move virtio-pci.h into shared include space 2022-05-16 04:38:40 -04:00
vhost-user-i2c.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
vhost-user-input-pci.c hw/virtio: derive vhost-user-input from vhost-user-base 2024-02-14 06:09:32 -05:00
vhost-user-input.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
vhost-user-rng-pci.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
vhost-user-rng.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
vhost-user-scmi-pci.c hw/virtio: Add vhost-user-scmi-pci boilerplate 2023-07-10 16:17:08 -04:00
vhost-user-scmi.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
vhost-user-scsi-pci.c Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
vhost-user-snd-pci.c hw/virtio: Remove empty Property lists 2024-12-19 19:33:37 +01:00
vhost-user-snd.c vhost-user-snd: correct the calculation of config_size 2025-02-21 07:21:25 -05:00
vhost-user-vsock-pci.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
vhost-user-vsock.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
vhost-user.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
vhost-vdpa.c vhost-iova-tree, svq: Implement GPA->IOVA & partial IOVA->HVA trees 2025-02-21 07:18:42 -05:00
vhost-vsock-common.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
vhost-vsock-pci.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
vhost-vsock.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
vhost.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
virtio-9p-pci.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
virtio-acpi.c license: Update deprecated SPDX tag GPL-2.0+ to GPL-2.0-or-later 2024-09-20 10:11:59 +03:00
virtio-balloon-pci.c hw/virtio: move virtio-pci.h into shared include space 2022-05-16 04:38:40 -04:00
virtio-balloon.c hw/virtio: reset virtio balloon stats on machine reset 2025-02-21 07:18:42 -05:00
virtio-blk-pci.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
virtio-bus.c virtio: stop ioeventfd on reset 2022-06-14 16:50:30 +02:00
virtio-config-io.c hw/virtio: Extract config read/write accessors to virtio-config-io.c 2022-12-21 07:32:24 -05:00
virtio-crypto-pci.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
virtio-crypto.c Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
virtio-hmp-cmds.c virtio: Move HMP commands from monitor/ to hw/virtio/ 2023-02-04 07:56:54 +01:00
virtio-input-host-pci.c hw/virtio: move virtio-pci.h into shared include space 2022-05-16 04:38:40 -04:00
virtio-input-pci.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
virtio-iommu-pci.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
virtio-iommu.c Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
virtio-md-pci.c hw/mem/memory-device: Remove legacy_align from memory_device_pre_plug() 2024-06-19 12:40:49 +02:00
virtio-md-stubs.c hw/virtio: move stubs out of stubs/ 2024-04-18 11:17:27 +02:00
virtio-mem-pci.c virtio-mem: Expose device memory dynamically via multiple memslots if enabled 2023-10-12 14:15:22 +02:00
virtio-mem-pci.h virtio-md-pci: New parent type for virtio-mem-pci and virtio-pmem-pci 2023-07-12 09:27:25 +02:00
virtio-mem.c Hi, 2024-12-22 14:33:27 -05:00
virtio-mmio.c Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
virtio-net-pci.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
virtio-nsm-pci.c device/virtio-nsm: Support for Nitro Secure Module device 2024-10-31 18:28:32 +01:00
virtio-nsm.c hw/virtio/virtio-nsm: Respond with correct length 2025-02-21 07:20:52 -05:00
virtio-pci.c Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
virtio-pmem-pci.c virtio-md-pci: New parent type for virtio-mem-pci and virtio-pmem-pci 2023-07-12 09:27:25 +02:00
virtio-pmem-pci.h virtio-md-pci: New parent type for virtio-mem-pci and virtio-pmem-pci 2023-07-12 09:27:25 +02:00
virtio-pmem.c Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
virtio-qmp.c qmp: update vhost-user protocol feature maps 2024-12-28 14:42:53 +03:00
virtio-qmp.h qmp: remove virtio_list, search QOM tree instead 2023-10-04 04:54:24 -04:00
virtio-rng-pci.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
virtio-rng.c Accel & Exec patch queue 2024-12-21 11:07:00 -05:00
virtio-scsi-pci.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
virtio-serial-pci.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 2024-12-19 19:36:37 +01:00
virtio-stub.c qmp: add QMP command x-query-virtio-queue-element 2022-10-09 16:38:45 -04:00
virtio.c Accel & Exec patch queue 2024-12-21 11:07:00 -05:00