aboutsummaryrefslogtreecommitdiff
path: root/block/qcow2-bitmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/qcow2-bitmap.c')
-rw-r--r--block/qcow2-bitmap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c
index 90756cf561..2d8dcba3e8 100644
--- a/block/qcow2-bitmap.c
+++ b/block/qcow2-bitmap.c
@@ -1109,7 +1109,7 @@ static uint64_t *store_bitmap_data(BlockDriverState *bs,
sbc = limit >> BDRV_SECTOR_BITS;
assert(DIV_ROUND_UP(bm_size, limit) == tb_size);
- while ((sector = bdrv_dirty_iter_next(dbi)) != -1) {
+ while ((sector = bdrv_dirty_iter_next(dbi) >> BDRV_SECTOR_BITS) >= 0) {
uint64_t cluster = sector / sbc;
uint64_t end, write_size;
int64_t off;