summaryrefslogtreecommitdiff
path: root/block/vhdx.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/vhdx.c')
-rw-r--r--block/vhdx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/vhdx.c b/block/vhdx.c
index 87c99fc260..5819fcf2f6 100644
--- a/block/vhdx.c
+++ b/block/vhdx.c
@@ -945,7 +945,8 @@ static int vhdx_open(BlockDriverState *bs, QDict *options, int flags,
/* the VHDX spec dictates that virtual_disk_size is always a multiple of
* logical_sector_size */
- bs->total_sectors = s->virtual_disk_size >> s->logical_sector_size_bits;
+ bdrv_setlength(bs, BDRV_SECTOR_SIZE *
+ (s->virtual_disk_size >> s->logical_sector_size_bits));
vhdx_calc_bat_entries(s);