summaryrefslogtreecommitdiff
path: root/block/bochs.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/bochs.c')
-rw-r--r--block/bochs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/block/bochs.c b/block/bochs.c
index 199ac2b9af..d2053094bc 100644
--- a/block/bochs.c
+++ b/block/bochs.c
@@ -118,9 +118,11 @@ static int bochs_open(BlockDriverState *bs, QDict *options, int flags,
}
if (le32_to_cpu(bochs.version) == HEADER_V1) {
- bs->total_sectors = le64_to_cpu(bochs.extra.redolog_v1.disk) / 512;
+ bdrv_setlength(bs, BDRV_SECTOR_SIZE *
+ (le64_to_cpu(bochs.extra.redolog_v1.disk) / 512));
} else {
- bs->total_sectors = le64_to_cpu(bochs.extra.redolog.disk) / 512;
+ bdrv_setlength(bs, BDRV_SECTOR_SIZE *
+ (le64_to_cpu(bochs.extra.redolog.disk) / 512));
}
/* Limit to 1M entries to avoid unbounded allocation. This is what is