summaryrefslogtreecommitdiff
path: root/block/sheepdog.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/sheepdog.c')
-rw-r--r--block/sheepdog.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/sheepdog.c b/block/sheepdog.c
index 12cbd9dcb4..6072aea9e0 100644
--- a/block/sheepdog.c
+++ b/block/sheepdog.c
@@ -1496,7 +1496,7 @@ static int sd_open(BlockDriverState *bs, QDict *options, int flags,
s->min_dirty_data_idx = UINT32_MAX;
s->max_dirty_data_idx = 0;
- bs->total_sectors = s->inode.vdi_size / BDRV_SECTOR_SIZE;
+ bdrv_setlength(bs, BDRV_SECTOR_SIZE * (s->inode.vdi_size / BDRV_SECTOR_SIZE));
pstrcpy(s->name, sizeof(s->name), vdi);
qemu_co_mutex_init(&s->lock);
qemu_opts_del(opts);