diff --git a/block/vhdx.c b/block/vhdx.c index f1e1e2e007..bec10bd09c 100644 --- a/block/vhdx.c +++ b/block/vhdx.c @@ -1111,6 +1111,7 @@ static coroutine_fn int vhdx_co_readv(BlockDriverState *bs, int64_t sector_num, case PAYLOAD_BLOCK_NOT_PRESENT: /* fall through */ case PAYLOAD_BLOCK_UNDEFINED: case PAYLOAD_BLOCK_UNMAPPED: + case PAYLOAD_BLOCK_UNMAPPED_v095: case PAYLOAD_BLOCK_ZERO: /* return zero */ qemu_iovec_memset(&hd_qiov, 0, 0, sinfo.bytes_avail); @@ -1277,10 +1278,10 @@ static coroutine_fn int vhdx_co_writev(BlockDriverState *bs, int64_t sector_num, sectors_to_write += iov2.iov_len >> BDRV_SECTOR_BITS; } } - /* fall through */ case PAYLOAD_BLOCK_NOT_PRESENT: /* fall through */ case PAYLOAD_BLOCK_UNMAPPED: + case PAYLOAD_BLOCK_UNMAPPED_v095: case PAYLOAD_BLOCK_UNDEFINED: bat_prior_offset = sinfo.file_offset; ret = vhdx_allocate_block(bs, s, &sinfo.file_offset); diff --git a/block/vhdx.h b/block/vhdx.h index b4a12a081e..7003ab7a79 100644 --- a/block/vhdx.h +++ b/block/vhdx.h @@ -226,7 +226,8 @@ typedef struct QEMU_PACKED VHDXLogDataSector { #define PAYLOAD_BLOCK_NOT_PRESENT 0 #define PAYLOAD_BLOCK_UNDEFINED 1 #define PAYLOAD_BLOCK_ZERO 2 -#define PAYLOAD_BLOCK_UNMAPPED 5 +#define PAYLOAD_BLOCK_UNMAPPED 3 +#define PAYLOAD_BLOCK_UNMAPPED_v095 5 #define PAYLOAD_BLOCK_FULLY_PRESENT 6 #define PAYLOAD_BLOCK_PARTIALLY_PRESENT 7