]> git.proxmox.com Git - mirror_qemu.git/commitdiff
block: bdrv_cow_child() for bdrv_has_zero_init()
authorMax Reitz <mreitz@redhat.com>
Wed, 12 Jun 2019 15:10:46 +0000 (17:10 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 7 Sep 2020 10:31:30 +0000 (12:31 +0200)
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

diff --git a/block.c b/block.c
index b16214260986a8939de80bf7d29d71e63ce3dd2c..656baa521ec14ed52da3823f3b4e3f72905fe104 100644 (file)
--- 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) {