From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54180) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXSDR-0001zr-9s for qemu-devel@nongnu.org; Thu, 24 May 2012 03:12:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SXSDK-0004Oi-W4 for qemu-devel@nongnu.org; Thu, 24 May 2012 03:12:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1026) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SXSDK-0004OL-OT for qemu-devel@nongnu.org; Thu, 24 May 2012 03:12:02 -0400 Message-ID: <4FBDDF37.1080405@redhat.com> Date: Thu, 24 May 2012 09:11:51 +0200 From: Gerd Hoffmann MIME-Version: 1.0 References: <4FA2D4C8.7010007@siemens.com> In-Reply-To: <4FA2D4C8.7010007@siemens.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1.1] audio: Always call fini on exit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: qemu-devel On 05/03/12 20:56, Jan Kiszka wrote: > Not only clean up enabled voices but any registered one. Backends like > pulsaudio rely on unconditional fini handler invocations. > > This fixes "Memory pool destroyed but not all memory blocks freed!" > warnings on VM shutdowns when pa is used. > > Signed-off-by: Jan Kiszka > --- > audio/audio.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/audio/audio.c b/audio/audio.c > index bd9237e..4b6e06c 100644 > --- a/audio/audio.c > +++ b/audio/audio.c > @@ -1775,7 +1775,7 @@ static void audio_atexit (void) > HWVoiceOut *hwo = NULL; > HWVoiceIn *hwi = NULL; > > - while ((hwo = audio_pcm_hw_find_any_enabled_out (hwo))) { > + while ((hwo = audio_pcm_hw_find_any_out (hwo))) { > SWVoiceCap *sc; > > hwo->pcm_ops->ctl_out (hwo, VOICE_DISABLE); I think you better call VOICE_DISABLE only in case the voice is actually enabled. > @@ -1791,7 +1791,7 @@ static void audio_atexit (void) > } > } > > - while ((hwi = audio_pcm_hw_find_any_enabled_in (hwi))) { > + while ((hwi = audio_pcm_hw_find_any_in (hwi))) { > hwi->pcm_ops->ctl_in (hwi, VOICE_DISABLE); Likewise. > hwi->pcm_ops->fini_in (hwi); > } cheers, Gerd