aboutsummaryrefslogtreecommitdiff
path: root/include/block
diff options
context:
space:
mode:
authorEmanuele Giuseppe Esposito <eesposit@redhat.com>2021-06-24 09:20:42 +0200
committerVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>2021-06-25 14:33:39 +0300
commitd0c389d2ce6031d80e872e8e1b6ebb0f96afbe69 (patch)
tree1f057ad12646046d4cc8e33b6e463544fea69d12 /include/block
parente3dd339feec2da3bcd82021e4ce4fe09dbf9c8b4 (diff)
downloadqemu-d0c389d2ce6031d80e872e8e1b6ebb0f96afbe69.zip
qemu-d0c389d2ce6031d80e872e8e1b6ebb0f96afbe69.tar.gz
qemu-d0c389d2ce6031d80e872e8e1b6ebb0f96afbe69.tar.bz2
block-copy: add CoMutex lock
Group various structures fields, to better understand what we need to protect with a lock and what doesn't need it. Then, add a CoMutex to protect concurrent access of block-copy data structures. This mutex also protects .copy_bitmap, because its thread-safe API does not prevent it from assigning two tasks to the same bitmap region. Exceptions to the lock: - .sleep_state is handled in the series "coroutine: new sleep/wake API" and thus here left as TODO. - .finished, .cancelled and reads to .ret and .error_is_read will be protected in the following patch, because are used also outside coroutines. - .skip_unallocated is atomic. Including it under the mutex would increase the critical sections and make them also much more complex. We can have it as atomic since it is only written from outside and read by block-copy coroutines. Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Message-Id: <20210624072043.180494-5-eesposit@redhat.com> [vsementsov: fix typo in comment] Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Diffstat (limited to 'include/block')
0 files changed, 0 insertions, 0 deletions