Like for most other image formats, vhdx images read as all zero in qemu
after their creation (we're taking advantage from the fact that qemu has
just created the image, because PAYLOAD_BLOCK_NOT_PRESENT actually means
undefined rather than zeroed according to the spec).

This fixes that 'qemu-img convert' to vhdx fully populates the image.

Signed-off-by: Kevin Wolf <kw...@redhat.com>
---
 block/vhdx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/block/vhdx.c b/block/vhdx.c
index 12bfe75..8a54da0 100644
--- a/block/vhdx.c
+++ b/block/vhdx.c
@@ -1951,6 +1951,7 @@ static BlockDriver bdrv_vhdx = {
     .bdrv_co_readv          = vhdx_co_readv,
     .bdrv_co_writev         = vhdx_co_writev,
     .bdrv_create            = vhdx_create,
+    .bdrv_has_zero_init     = bdrv_has_zero_init_1,
     .bdrv_get_info          = vhdx_get_info,
     .bdrv_check             = vhdx_check,
 
-- 
1.8.3.1


Reply via email to