[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] block: Invalidate all children
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] block: Invalidate all children |
Date: |
Wed, 4 May 2016 12:10:23 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
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 <address@hidden>
> ---
> 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.
Kevin
- Re: [Qemu-devel] [PATCH 1/2] block: Invalidate all children,
Kevin Wolf <=