From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOdGc-0004jn-Hd for qemu-devel@nongnu.org; Wed, 27 Jan 2016 22:29:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOdGb-0004VD-Pu for qemu-devel@nongnu.org; Wed, 27 Jan 2016 22:29:06 -0500 Date: Thu, 28 Jan 2016 11:28:56 +0800 From: Fam Zheng Message-ID: <20160128032856.GK7877@ad.usersys.redhat.com> References: <1453917600-2663-1-git-send-email-mreitz@redhat.com> <1453917600-2663-9-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1453917600-2663-9-git-send-email-mreitz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v8 08/16] block: Use blk_remove_bs() in blk_delete() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Kevin Wolf , Alberto Garcia , qemu-block@nongnu.org, John Snow , qemu-devel@nongnu.org, Paolo Bonzini On Wed, 01/27 18:59, Max Reitz wrote: > Signed-off-by: Max Reitz > Reviewed-by: Kevin Wolf > --- > block/block-backend.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/block/block-backend.c b/block/block-backend.c > index 621787c..7f5ad59 100644 > --- a/block/block-backend.c > +++ b/block/block-backend.c > @@ -166,10 +166,7 @@ static void blk_delete(BlockBackend *blk) > assert(!blk->refcnt); > assert(!blk->dev); > if (blk->bs) { > - assert(blk->bs->blk == blk); > - blk->bs->blk = NULL; > - bdrv_unref(blk->bs); > - blk->bs = NULL; > + blk_remove_bs(blk); > } > assert(QLIST_EMPTY(&blk->remove_bs_notifiers.notifiers)); > assert(QLIST_EMPTY(&blk->insert_bs_notifiers.notifiers)); > @@ -351,6 +348,8 @@ void blk_hide_on_behalf_of_hmp_drive_del(BlockBackend *blk) > */ > void blk_remove_bs(BlockBackend *blk) > { > + assert(blk->bs->blk == blk); > + > notifier_list_notify(&blk->remove_bs_notifiers, blk); > > blk_update_root_state(blk); > -- > 2.7.0 > Reviewed-by: Fam Zheng