mbox series

[v1,0/4] virtio_snd_set_config: Fix #2296

Message ID cover.1713789200.git.manos.pitsidianakis@linaro.org (mailing list archive)
Headers show
Series virtio_snd_set_config: Fix #2296 | expand

Message

Manos Pitsidianakis April 22, 2024, 12:52 p.m. UTC
Changing the number of streams via virtio_snd_set_config() did not
re-configure the audio card, leaving it in an invalid state.

Reported in https://gitlab.com/qemu-project/qemu/-/issues/2296

Manos Pitsidianakis (4):
  virtio-snd: add virtio_snd_is_config_valid()
  virtio-snd: factor card setup out of realize func
  virtio-snd: factor card removal out of unrealize()
  virtio_snd_set_config: validate and re-setup card

 hw/audio/virtio-snd.c | 174 +++++++++++++++++++++++++-----------------
 1 file changed, 105 insertions(+), 69 deletions(-)


base-commit: 62dbe54c24dbf77051bafe1039c31ddc8f37602d

Comments

Volker RĂ¼melin Sept. 1, 2024, 1:25 p.m. UTC | #1
Am 22.04.24 um 14:52 schrieb Manos Pitsidianakis:
> Changing the number of streams via virtio_snd_set_config() did not
> re-configure the audio card, leaving it in an invalid state.
>
> Reported in https://gitlab.com/qemu-project/qemu/-/issues/2296
>
> Manos Pitsidianakis (4):
>   virtio-snd: add virtio_snd_is_config_valid()
>   virtio-snd: factor card setup out of realize func
>   virtio-snd: factor card removal out of unrealize()
>   virtio_snd_set_config: validate and re-setup card
>
>  hw/audio/virtio-snd.c | 174 +++++++++++++++++++++++++-----------------
>  1 file changed, 105 insertions(+), 69 deletions(-)
>
>
> base-commit: 62dbe54c24dbf77051bafe1039c31ddc8f37602d

Hi Manos,

I don't think the virtio_snd_set_config function is necessary. The
virtio sound device specification in chapter 5.14.4 states that all
fields in the configuration space are driver-read-only. I wrote a patch
to remove the virtio_snd_set_config function. The patch can be found at
https://lists.nongnu.org/archive/html/qemu-devel/2024-09/msg00003.html.

With best regards,
Volker