qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
	qemu-devel@nongnu.org
Cc: "Volker Rümelin" <vr_qemu@t-online.de>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH-for-8.2] virtio-sound: add realize() error cleanup path
Date: Thu, 16 Nov 2023 08:32:05 +0100	[thread overview]
Message-ID: <88363f15-697b-4b04-ad4d-af0aa5fb75aa@linaro.org> (raw)
In-Reply-To: <20231116072046.4002957-1-manos.pitsidianakis@linaro.org>

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	other threads:[~2023-11-16  7:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-16  7:20 [PATCH-for-8.2] virtio-sound: add realize() error cleanup path Manos Pitsidianakis
2023-11-16  7:32 ` Philippe Mathieu-Daudé [this message]
2023-11-16  7:33   ` Manos Pitsidianakis
2023-11-16  8:42     ` Philippe Mathieu-Daudé
2023-11-16  8:48       ` Manos Pitsidianakis
2023-11-16  8:54         ` Philippe Mathieu-Daudé
2023-11-16  9:16           ` Manos Pitsidianakis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=88363f15-697b-4b04-ad4d-af0aa5fb75aa@linaro.org \
    --to=philmd@linaro.org \
    --cc=kraxel@redhat.com \
    --cc=manos.pitsidianakis@linaro.org \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vr_qemu@t-online.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).