From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50152) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ay7EZ-00040h-0u for qemu-devel@nongnu.org; Wed, 04 May 2016 20:33:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ay7EN-0006qQ-Cy for qemu-devel@nongnu.org; Wed, 04 May 2016 20:33:33 -0400 Date: Thu, 5 May 2016 08:32:55 +0800 From: Fam Zheng Message-ID: <20160505003255.GB13202@ad.usersys.redhat.com> References: <1461030177-29144-1-git-send-email-famz@redhat.com> <1461030177-29144-2-git-send-email-famz@redhat.com> <20160504101023.GB14972@noname.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160504101023.GB14972@noname.str.redhat.com> Subject: Re: [Qemu-devel] [PATCH 1/2] block: Invalidate all children List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, Max Reitz On Wed, 05/04 12:10, Kevin Wolf wrote: > Am 19.04.2016 um 03:42 hat Fam Zheng geschrieben: > > Currently we only recurse to bs->file, which will miss the children in quorum > > and VMDK. > > > > Recurse into the whole subtree to avoid that. > > > > Signed-off-by: Fam Zheng > > --- > > block.c | 20 ++++++++++++++------ > > 1 file changed, 14 insertions(+), 6 deletions(-) > > > > diff --git a/block.c b/block.c > > index d4939b4..fa8b38f 100644 > > --- a/block.c > > +++ b/block.c > > @@ -3201,6 +3201,7 @@ void bdrv_init_with_whitelist(void) > > > > void bdrv_invalidate_cache(BlockDriverState *bs, Error **errp) > > { > > + BdrvChild *child; > > Error *local_err = NULL; > > int ret; > > > > @@ -3215,13 +3216,20 @@ void bdrv_invalidate_cache(BlockDriverState *bs, Error **errp) > > > > if (bs->drv->bdrv_invalidate_cache) { > > bs->drv->bdrv_invalidate_cache(bs, &local_err); > > - } else if (bs->file) { > > - bdrv_invalidate_cache(bs->file->bs, &local_err); > > The old behaviour was that we only recurse for bs->file if the block > driver doesn't have its own implementation. > > This means that in qcow2, for example, we call bdrv_invalidate_cache() > explicitly for bs->file. If we can already invalidate it here, the call > inside qcow2 and probably other drivers could go away. Yes, will update. Thanks. Fam