20.01.2020 17:18, Max Reitz wrote: > On 19.12.19 11:03, Vladimir Sementsov-Ogievskiy wrote: >> store_bitmap_data() loop does bdrv_set_dirty_iter() on each iteration, >> which means that we actually don't need iterator itself and we can use >> simpler bitmap API. >> >> Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]> >> --- >> block/qcow2-bitmap.c | 11 +++++------ >> 1 file changed, 5 insertions(+), 6 deletions(-) >> >> diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c >> index c6c8ebbe89..015f5d18d2 100644 >> --- a/block/qcow2-bitmap.c >> +++ b/block/qcow2-bitmap.c > > [...] > >> @@ -1360,19 +1361,17 @@ static uint64_t *store_bitmap_data(BlockDriverState >> *bs, > > (One line more context:) > >> if (end >= bm_size) >> break; >> } > > Can we drop this now?
Yes, we can, as hbitmap_next_dirty returns -1 in this case. > > If so, and with that done: > > Reviewed-by: Max Reitz <[email protected]> > >> >> - bdrv_set_dirty_iter(dbi, end); >> + offset = end; >> } > -- Best regards, Vladimir
