qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH 3/3] vpc: Do not return RAW from block_status


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [Qemu-block] [PATCH 3/3] vpc: Do not return RAW from block_status
Date: Mon, 12 Aug 2019 15:33:30 +0000

25.07.2019 18:55, Max Reitz wrote:
> vpc is not really a passthrough driver, even when using the fixed
> subformat (where host and guest offsets are equal).  It should handle
> preallocation like all other drivers do, namely by returning
> DATA | RECURSE instead of RAW.
> 
> There is no tangible difference but the fact that bdrv_is_allocated() no
> longer falls through to the protocol layer.

Hmm. Isn't a real bug (fixed by this patch) ?

Assume vpc->file is qcow2 with backing, which have "unallocated" region, which 
is
backed by actual data in backing file.

So, this region will be reported as not allocated and will be skipped by any 
copying
loop using block-status? Is it a bug of BDRV_BLOCK_RAW itself? Or I don't 
understand
something..

> 
> Signed-off-by: Max Reitz <address@hidden>
> ---
>   block/vpc.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/block/vpc.c b/block/vpc.c
> index d4776ee8a5..b25aab0425 100644
> --- a/block/vpc.c
> +++ b/block/vpc.c
> @@ -737,7 +737,7 @@ static int coroutine_fn 
> vpc_co_block_status(BlockDriverState *bs,
>           *pnum = bytes;
>           *map = offset;
>           *file = bs->file->bs;
> -        return BDRV_BLOCK_RAW | BDRV_BLOCK_OFFSET_VALID;
> +        return BDRV_BLOCK_DATA | BDRV_BLOCK_OFFSET_VALID | 
> BDRV_BLOCK_RECURSE;
>       }
>   
>       qemu_co_mutex_lock(&s->lock);
> 


-- 
Best regards,
Vladimir

reply via email to

[Prev in Thread] Current Thread [Next in Thread]