On 2017-09-25 17:38, Vladimir Sementsov-Ogievskiy wrote: > 13.09.2017 21:19, Max Reitz wrote: >> This new parameter allows the caller to just query the next dirty >> position without moving the iterator. >> >> Signed-off-by: Max Reitz >> --- >>   include/qemu/hbitmap.h |  4 +++- >>   block/dirty-bitmap.c   |  2 +- >>   tests/test-hbitmap.c   | 26 +++++++++++++------------- >>   util/hbitmap.c         | 10 +++++++--- >>   4 files changed, 24 insertions(+), 18 deletions(-) >> >> diff --git a/include/qemu/hbitmap.h b/include/qemu/hbitmap.h >> index d3a74a21fc..6a52575ad5 100644 >> --- a/include/qemu/hbitmap.h >> +++ b/include/qemu/hbitmap.h >> @@ -316,11 +316,13 @@ void hbitmap_free_meta(HBitmap *hb); >>   /** >>    * hbitmap_iter_next: >>    * @hbi: HBitmapIter to operate on. >> + * @advance: If true, advance the iterator.  Otherwise, the next call >> + *           of this function will return the same result. > > it's not quit right, as hbitmap iterator allows concurrent resetting of > bits, and in > this case next call may return some other result. (see f63ea4e92bad1db) Ah, right! I think it should still be useful for what I (currently) need in patch 12, I would just need a different description then. (Like "...will return the same result (if that position is still dirty).") Max