summary refs log tree commit diff stats
path: root/include/qemu
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2018-06-13 20:18:16 +0200
committerMax Reitz <mreitz@redhat.com>2018-06-18 17:04:55 +0200
commita33fbb4f8b64226becf502a123733776ce319b24 (patch)
treef561b258d5c978b7dfd957aefd489d95482ae744 /include/qemu
parentec9f10fe064f2abb9dc60a9fa580d8d0933f2acf (diff)
downloadfocaccia-qemu-a33fbb4f8b64226becf502a123733776ce319b24.tar.gz
focaccia-qemu-a33fbb4f8b64226becf502a123733776ce319b24.zip
hbitmap: Add @advance param to hbitmap_iter_next()
This new parameter allows the caller to just query the next dirty
position without moving the iterator.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Message-id: 20180613181823.13618-8-mreitz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'include/qemu')
-rw-r--r--include/qemu/hbitmap.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/qemu/hbitmap.h b/include/qemu/hbitmap.h
index 6b6490ecad..ddca52c48e 100644
--- a/include/qemu/hbitmap.h
+++ b/include/qemu/hbitmap.h
@@ -324,11 +324,14 @@ 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 (if that
+ *           position is still dirty).
  *
  * Return the next bit that is set in @hbi's associated HBitmap,
  * or -1 if all remaining bits are zero.
  */
-int64_t hbitmap_iter_next(HBitmapIter *hbi);
+int64_t hbitmap_iter_next(HBitmapIter *hbi, bool advance);
 
 /**
  * hbitmap_iter_next_word: