From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2bnv-0003in-Bj for qemu-devel@nongnu.org; Fri, 26 Jul 2013 02:47:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V2bnu-0006hg-A0 for qemu-devel@nongnu.org; Fri, 26 Jul 2013 02:47:07 -0400 Received: from e28smtp07.in.ibm.com ([122.248.162.7]:38690) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2bnr-0006a2-Dx for qemu-devel@nongnu.org; Fri, 26 Jul 2013 02:47:06 -0400 Received: from /spool/local by e28smtp07.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 26 Jul 2013 12:08:28 +0530 Message-ID: <51F21AA0.3090406@linux.vnet.ibm.com> Date: Fri, 26 Jul 2013 14:43:44 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1374765505-14356-1-git-send-email-stefanha@redhat.com> <1374765505-14356-2-git-send-email-stefanha@redhat.com> In-Reply-To: <1374765505-14356-2-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 7bit 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: Stefan Hajnoczi Cc: Kevin Wolf , Ping Fan Liu , Michael Roth , qemu-stable@nongnu.org, qemu-devel@nongnu.org, alex@alex.org.uk, Paolo Bonzini Reviewed-by: Wenchao Xia One question: old code missed itself in bdrv_drain_all(), is that a bug? > 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); > } > -- Best Regards Wenchao Xia