block/block-copy: refactor task creation
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Wed, 29 Apr 2020 13:08:46 +0000 (16:08 +0300)
committerMax Reitz <mreitz@redhat.com>
Tue, 5 May 2020 12:03:28 +0000 (14:03 +0200)
commit42ac214406e092038b13f02c2ff9768d4dd41e1b
tree12aaae0de129bdb401f3fee793455231aeb21822
parent1348a65774d2a5bfbf8ba5c52a07b02126326e17
block/block-copy: refactor task creation

Instead of just relying on the comment "Called only on full-dirty
region" in block_copy_task_create() let's move initial dirty area
search directly to block_copy_task_create(). Let's also use effective
bdrv_dirty_bitmap_next_dirty_area instead of looping through all
non-dirty clusters.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20200429130847.28124-5-vsementsov@virtuozzo.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/block-copy.c