aboutsummaryrefslogtreecommitdiff
path: root/block
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 /block
parentec9f10fe064f2abb9dc60a9fa580d8d0933f2acf (diff)
downloadqemu-a33fbb4f8b64226becf502a123733776ce319b24.zip
qemu-a33fbb4f8b64226becf502a123733776ce319b24.tar.gz
qemu-a33fbb4f8b64226becf502a123733776ce319b24.tar.bz2
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 'block')
-rw-r--r--block/backup.c2
-rw-r--r--block/dirty-bitmap.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/block/backup.c b/block/backup.c
index 5661435..d18be40 100644
--- a/block/backup.c
+++ b/block/backup.c
@@ -354,7 +354,7 @@ static int coroutine_fn backup_run_incremental(BackupBlockJob *job)
HBitmapIter hbi;
hbitmap_iter_init(&hbi, job->copy_bitmap, 0);
- while ((cluster = hbitmap_iter_next(&hbi)) != -1) {
+ while ((cluster = hbitmap_iter_next(&hbi, true)) != -1) {
do {
if (yield_and_check(job)) {
return 0;
diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
index 383d742..cedb971 100644
--- a/block/dirty-bitmap.c
+++ b/block/dirty-bitmap.c
@@ -519,7 +519,7 @@ void bdrv_dirty_iter_free(BdrvDirtyBitmapIter *iter)
int64_t bdrv_dirty_iter_next(BdrvDirtyBitmapIter *iter)
{
- return hbitmap_iter_next(&iter->hbi);
+ return hbitmap_iter_next(&iter->hbi, true);
}
/* Called within bdrv_dirty_bitmap_lock..unlock */