[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v6 07/42] block: *filtered_cow_child() for *has_zero
From: |
Max Reitz |
Subject: |
[Qemu-block] [PATCH v6 07/42] block: *filtered_cow_child() for *has_zero_init() |
Date: |
Fri, 9 Aug 2019 18:13:32 +0200 |
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>
Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>
---
block.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block.c b/block.c
index bfa5e27850..486c75d847 100644
--- a/block.c
+++ b/block.c
@@ -5063,7 +5063,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;
}
if (bs->drv->bdrv_has_zero_init) {
@@ -5081,7 +5081,7 @@ bool bdrv_unallocated_blocks_are_zero(BlockDriverState
*bs)
{
BlockDriverInfo bdi;
- if (bs->backing) {
+ if (bdrv_filtered_cow_child(bs)) {
return false;
}
--
2.21.0
- [Qemu-block] [PATCH v6 00/42] block: Deal with filters, Max Reitz, 2019/08/09
- [Qemu-block] [PATCH v6 01/42] block: Mark commit and mirror as filter drivers, Max Reitz, 2019/08/09
- [Qemu-block] [PATCH v6 02/42] copy-on-read: Support compressed writes, Max Reitz, 2019/08/09
- [Qemu-block] [PATCH v6 03/42] throttle: Support compressed writes, Max Reitz, 2019/08/09
- [Qemu-block] [PATCH v6 04/42] block: Add child access functions, Max Reitz, 2019/08/09
- [Qemu-block] [PATCH v6 06/42] qcow2: Implement .bdrv_storage_child(), Max Reitz, 2019/08/09
- [Qemu-block] [PATCH v6 05/42] block: Add chain helper functions, Max Reitz, 2019/08/09
- [Qemu-block] [PATCH v6 07/42] block: *filtered_cow_child() for *has_zero_init(),
Max Reitz <=
- [Qemu-block] [PATCH v6 08/42] block: bdrv_set_backing_hd() is about bs->backing, Max Reitz, 2019/08/09
- [Qemu-block] [PATCH v6 09/42] block: Include filters when freezing backing chain, Max Reitz, 2019/08/09
- [Qemu-block] [PATCH v6 10/42] block: Drop bdrv_is_encrypted(), Max Reitz, 2019/08/09
- [Qemu-block] [PATCH v6 11/42] block: Add bdrv_supports_compressed_writes(), Max Reitz, 2019/08/09
- [Qemu-block] [PATCH v6 12/42] block: Use bdrv_filtered_rw* where obvious, Max Reitz, 2019/08/09
- [Qemu-block] [PATCH v6 13/42] block: Use CAFs in block status functions, Max Reitz, 2019/08/09
- [Qemu-block] [PATCH v6 14/42] block: Use CAFs when working with backing chains, Max Reitz, 2019/08/09