hw/audio/virtio-sound: return correct command response size
commit633487df8d303b37a88584d5a57a39dbcd91c7bf
authorVolker Rümelin <vr_qemu@t-online.de>
Sun, 18 Feb 2024 08:33:41 +0000 (18 09:33 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 12 Mar 2024 21:56:55 +0000 (12 17:56 -0400)
tree6e66905f675403d5bcbbe76c7fe57950f4b74d7f
parent3a95f572112ab4c789d66af666644adcdb2b45a6
hw/audio/virtio-sound: return correct command response size

The payload size returned by command VIRTIO_SND_R_PCM_INFO is
wrong. The code in process_cmd() assumes that all commands
return only a virtio_snd_hdr payload, but some commands like
VIRTIO_SND_R_PCM_INFO may return an additional payload.

Add a zero initialized payload_size variable to struct
virtio_snd_ctrl_command to allow for additional payloads.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Volker Rümelin <vr_qemu@t-online.de>
Message-Id: <20240218083351.8524-1-vr_qemu@t-online.de>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/audio/virtio-snd.c
include/hw/audio/virtio-snd.h