qemu-block
[Top][All Lists]
Advanced

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

[PULL 19/64] block: bdrv_cow_child() for bdrv_has_zero_init()


From: Kevin Wolf
Subject: [PULL 19/64] block: bdrv_cow_child() for bdrv_has_zero_init()
Date: Mon, 7 Sep 2020 13:08:51 +0200

From: Max Reitz <mreitz@redhat.com>

bdrv_has_zero_init() should use bdrv_cow_child() if it wants to check
whether the given BDS has a COW backing file.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
---
 block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block.c b/block.c
index b162142609..656baa521e 100644
--- a/block.c
+++ b/block.c
@@ -5415,7 +5415,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_cow_child(bs)) {
         return 0;
     }
     if (bs->drv->bdrv_has_zero_init) {
-- 
2.25.4




reply via email to

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