Received: from eggs.gnu.org ([2001:4830:134:3::10]:50762) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6yO7-0008Nc-Qd for qemu-devel@nongnu.org; Wed, 07 Aug 2013 03:42:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V6yO1-0002EI-Vx for qemu-devel@nongnu.org; Wed, 07 Aug 2013 03:42:31 -0400 Date: Wed, 7 Aug 2013 09:42:22 +0200 From: Stefan Hajnoczi Message-ID: <20130807074222.GF19825@stefanha-thinkpad.redhat.com> References: <1374765505-14356-1-git-send-email-stefanha@redhat.com> <1374765505-14356-2-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1374765505-14356-2-git-send-email-stefanha@redhat.com> Subject: Re: [Qemu-devel] [PATCH v6 01/18] block: ensure bdrv_drain_all() works during bdrv_delete() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Ping Fan Liu , Stefan Hajnoczi , qemu-stable@nongnu.org, qemu-devel@nongnu.org, alex@alex.org.uk, Paolo Bonzini , Michael Roth On Thu, Jul 25, 2013 at 05:18:08PM +0200, Stefan Hajnoczi wrote: > In bdrv_delete() make sure to call bdrv_make_anon() *after* bdrv_close() > so that the device is still seen by bdrv_drain_all() when iterating > bdrv_states. > > Cc: qemu-stable@nongnu.org > Signed-off-by: Stefan Hajnoczi > --- > block.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/block.c b/block.c > index 6cd39fa..9d68270 100644 > --- a/block.c > +++ b/block.c > @@ -1600,11 +1600,11 @@ void bdrv_delete(BlockDriverState *bs) > assert(!bs->job); > assert(!bs->in_use); > > + bdrv_close(bs); > + > /* remove from list, if necessary */ > bdrv_make_anon(bs); > > - bdrv_close(bs); > - > g_free(bs); > } Kevin: Although I haven't seen reports of this bug, it might be a good idea to merge this single patch for QEMU 1.6. Stefan