qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH-for-8.2] virtio-sound: add realize() error cleanup path


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH-for-8.2] virtio-sound: add realize() error cleanup path
Date: Thu, 16 Nov 2023 08:32:05 +0100
User-agent: Mozilla Thunderbird

Hi Manos,

On 16/11/23 08:20, Manos Pitsidianakis wrote:
QEMU crashes on exit when a virtio-sound device has failed to
realise. Its vmstate field was not cleaned up properly with
qemu_del_vm_change_state_handler().

This patch changes the realize() order as

1. Validate the given configuration values (no resources allocated
    by us either on success or failure)
2. Try AUD_register_card() and return on failure (no resources allocated
    by us on failure)
3. Initialize vmstate, virtio device, heap allocations and stream
    parameters at once.
    If error occurs, goto error_cleanup label which calls
    virtio_snd_unrealize(). This cleans up all resources made in steps
    1-3.

Reported-by: Volker Rümelin <vr_qemu@t-online.de>
Fixes: 2880e676c000 ("Add virtio-sound device stub")
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
---

Notes:
     Requires patch <20231109162034.2108018-1-manos.pitsidianakis@linaro.org>

This is the 'Based-on: ' tag I guess.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

  hw/audio/virtio-snd.c | 39 ++++++++++++++++++++++-----------------
  1 file changed, 22 insertions(+), 17 deletions(-)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]