]> git.proxmox.com Git - mirror_qemu.git/commit
block/block-copy: refactor copying
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Tue, 22 Oct 2019 11:18:02 +0000 (14:18 +0300)
committerMax Reitz <mreitz@redhat.com>
Mon, 28 Oct 2019 10:22:31 +0000 (11:22 +0100)
commite332a726da322c5c68bc34ffb59384e31e36d0ff
treee2c07f677aaed53024a6c1e4a8d241cf2597ee62
parentb3b7036afbf564268ad7edc10fb28501af0709e9
block/block-copy: refactor copying

Merge copying code into one function block_copy_do_copy, which only
calls bdrv_ io functions and don't do any synchronization (like dirty
bitmap set/reset).

Refactor block_copy() function so that it takes full decision about
size of chunk to be copied and does all the synchronization (checking
intersecting requests, set/reset dirty bitmaps).

It will help:
 - introduce parallel processing of block_copy iterations: we need to
   calculate chunk size, start async chunk copying and go to the next
   iteration
 - simplify synchronization improvement (like memory limiting in
   further commit and reducing critical section (now we lock the whole
   requested range, when actually we need to lock only dirty region
   which we handle at the moment))

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 20191022111805.3432-4-vsementsov@virtuozzo.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/block-copy.c
block/trace-events