aboutsummaryrefslogtreecommitdiff
path: root/block/qcow2.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2014-06-26 13:23:22 +0200
committerKevin Wolf <kwolf@redhat.com>2014-08-15 15:07:13 +0200
commit57322b7811a9136507742bb7ebc2215dd8c2e911 (patch)
treef21998bdcfbab129909170f2ba3df7f740cd3798 /block/qcow2.c
parent43716fa8058a9095b9c1f9be4397dbaf7c521ee0 (diff)
block: Use bdrv_nb_sectors() where sectors, not bytes are wanted
Instead of bdrv_getlength(). Aside: a few of these callers don't handle errors. I didn't investigate whether they should. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Benoit Canet <benoit@irqsave.net> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/qcow2.c')
-rw-r--r--block/qcow2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/qcow2.c b/block/qcow2.c
index 1e3ab6bd02..ad93824c6c 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -1557,7 +1557,7 @@ static int preallocate(BlockDriverState *bs)
int ret;
QCowL2Meta *meta;
- nb_sectors = bdrv_getlength(bs) >> BDRV_SECTOR_BITS;
+ nb_sectors = bdrv_nb_sectors(bs);
offset = 0;
while (nb_sectors) {