diff options
author | Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> | 2019-10-01 16:14:05 +0300 |
---|---|---|
committer | Max Reitz <mreitz@redhat.com> | 2019-10-10 10:56:18 +0200 |
commit | a6ffe1998cfe1fd3cd83de0a7d1dd16eb514f987 (patch) | |
tree | 2340299ddbb9c799fa5a9d9f0d63bd89551182a2 /include | |
parent | f2d86ade4da71d1f32ffc5977ea5417c20996919 (diff) | |
download | qemu-a6ffe1998cfe1fd3cd83de0a7d1dd16eb514f987.zip qemu-a6ffe1998cfe1fd3cd83de0a7d1dd16eb514f987.tar.gz qemu-a6ffe1998cfe1fd3cd83de0a7d1dd16eb514f987.tar.bz2 |
block/backup: move in-flight requests handling from backup to block-copy
Move synchronization mechanism to block-copy, to be able to use one
block-copy instance from backup job and backup-top filter in parallel.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-id: 20191001131409.14202-2-vsementsov@virtuozzo.com
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/block/block-copy.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/block/block-copy.h b/include/block/block-copy.h index 54f90d0..962f910 100644 --- a/include/block/block-copy.h +++ b/include/block/block-copy.h @@ -17,6 +17,13 @@ #include "block/block.h" +typedef struct BlockCopyInFlightReq { + int64_t start_byte; + int64_t end_byte; + QLIST_ENTRY(BlockCopyInFlightReq) list; + CoQueue wait_queue; /* coroutines blocked on this request */ +} BlockCopyInFlightReq; + typedef void (*ProgressBytesCallbackFunc)(int64_t bytes, void *opaque); typedef void (*ProgressResetCallbackFunc)(void *opaque); typedef struct BlockCopyState { @@ -27,6 +34,7 @@ typedef struct BlockCopyState { bool use_copy_range; int64_t copy_range_size; uint64_t len; + QLIST_HEAD(, BlockCopyInFlightReq) inflight_reqs; BdrvRequestFlags write_flags; |