summaryrefslogtreecommitdiff
path: root/block/cow.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/cow.c')
-rw-r--r--block/cow.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/cow.c b/block/cow.c
index 6ee483327f..1911bc6f03 100644
--- a/block/cow.c
+++ b/block/cow.c
@@ -91,7 +91,7 @@ static int cow_open(BlockDriverState *bs, QDict *options, int flags,
/* cow image found */
size = be64_to_cpu(cow_header.size);
- bs->total_sectors = size / 512;
+ bdrv_setlength(bs, BDRV_SECTOR_SIZE * (size / 512));
pstrcpy(bs->backing_file, sizeof(bs->backing_file),
cow_header.backing_file);