mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
dirty-bitmap: Set iterator start by offset, not sector
All callers to bdrv_dirty_iter_new() passed 0 for their initial starting point, drop that parameter. Most callers to bdrv_set_dirty_iter() were scaling a byte offset to a sector number; the exception qcow2-bitmap will be converted later to use byte rather than sector iteration. Move the scaling to occur internally to dirty bitmap code instead, so that callers now pass in bytes. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
c7e7c87ac8
commit
715a74d819
5 changed files with 12 additions and 15 deletions
|
@ -1103,7 +1103,7 @@ static uint64_t *store_bitmap_data(BlockDriverState *bs,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
dbi = bdrv_dirty_iter_new(bitmap, 0);
|
||||
dbi = bdrv_dirty_iter_new(bitmap);
|
||||
buf = g_malloc(s->cluster_size);
|
||||
limit = bytes_covered_by_bitmap_cluster(s, bitmap);
|
||||
sbc = limit >> BDRV_SECTOR_BITS;
|
||||
|
@ -1153,7 +1153,7 @@ static uint64_t *store_bitmap_data(BlockDriverState *bs,
|
|||
break;
|
||||
}
|
||||
|
||||
bdrv_set_dirty_iter(dbi, end);
|
||||
bdrv_set_dirty_iter(dbi, end * BDRV_SECTOR_SIZE);
|
||||
}
|
||||
|
||||
*bitmap_table_size = tb_size;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue