[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v5 07/42] block: *filtered_cow_child() for *has_
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
Re: [Qemu-block] [PATCH v5 07/42] block: *filtered_cow_child() for *has_zero_init() |
Date: |
Thu, 13 Jun 2019 12:34:18 +0000 |
13.06.2019 1:09, Max Reitz wrote:
> bdrv_has_zero_init() and the related bdrv_unallocated_blocks_are_zero()
> should use bdrv_filtered_cow_child() if they want to check whether the
> given BDS has a COW backing file.
>
> Signed-off-by: Max Reitz <address@hidden>
> ---
> block.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/block.c b/block.c
> index be18130944..64d6190984 100644
> --- a/block.c
> +++ b/block.c
> @@ -4933,7 +4933,7 @@ int bdrv_has_zero_init(BlockDriverState *bs)
>
> /* If BS is a copy on write image, it is initialized to
> the contents of the base image, which may not be zeroes. */
> - if (bs->backing) {
> + if (bdrv_filtered_cow_child(bs)) {
> return 0;
> }
Hmm, if you are fixing bdrv_has_zero_init around filters, I'd prefere to fix
the whole
function, converting the following here too:
if (bs->file && bs->drv->is_filter) {
return bdrv_has_zero_init(bs->file->bs);
}
But it's not a real problem:
Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> if (bs->drv->bdrv_has_zero_init) {
> @@ -4951,7 +4951,7 @@ bool bdrv_unallocated_blocks_are_zero(BlockDriverState
> *bs)
> {
> BlockDriverInfo bdi;
>
> - if (bs->backing) {
> + if (bdrv_filtered_cow_child(bs)) {
> return false;
> }
>
>
--
Best regards,
Vladimir
- Re: [Qemu-block] [PATCH v5 04/42] block: Add child access functions, (continued)
- [Qemu-block] [PATCH v5 06/42] qcow2: Implement .bdrv_storage_child(), Max Reitz, 2019/06/12
- [Qemu-block] [PATCH v5 08/42] block: bdrv_set_backing_hd() is about bs->backing, Max Reitz, 2019/06/12
- [Qemu-block] [PATCH v5 07/42] block: *filtered_cow_child() for *has_zero_init(), Max Reitz, 2019/06/12
- Re: [Qemu-block] [PATCH v5 07/42] block: *filtered_cow_child() for *has_zero_init(),
Vladimir Sementsov-Ogievskiy <=
- [Qemu-block] [PATCH v5 10/42] block: Use CAF in bdrv_is_encrypted(), Max Reitz, 2019/06/12
- [Qemu-block] [PATCH v5 11/42] block: Add bdrv_supports_compressed_writes(), Max Reitz, 2019/06/12
- [Qemu-block] [PATCH v5 09/42] block: Include filters when freezing backing chain, Max Reitz, 2019/06/12
- [Qemu-block] [PATCH v5 12/42] block: Use bdrv_filtered_rw* where obvious, Max Reitz, 2019/06/12