]> git.proxmox.com Git - mirror_qemu.git/commit - block/block-copy.c
block-copy: atomic .cancelled and .finished fields in BlockCopyCallState
authorEmanuele Giuseppe Esposito <eesposit@redhat.com>
Thu, 24 Jun 2021 07:20:43 +0000 (09:20 +0200)
committerVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Fri, 25 Jun 2021 11:33:51 +0000 (14:33 +0300)
commit149009bef4b4b4db37b3cf72b41dc2c6e8ca1885
treeb07a043b4259059d8eec8dd6bbf0ae733899b03e
parentd0c389d2ce6031d80e872e8e1b6ebb0f96afbe69
block-copy: atomic .cancelled and .finished fields in BlockCopyCallState

By adding acquire/release pairs, we ensure that .ret and .error_is_read
fields are written by block_copy_dirty_clusters before .finished is true,
and that they are read by API user after .finished is true.

The atomic here are necessary because the fields are concurrently modified
in coroutines, and read outside.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Message-Id: <20210624072043.180494-6-eesposit@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
block/block-copy.c
include/block/block-copy.h