The first patch adds a lock between bdrv_set_dirty{,_bitmap} and non-atomic (coroutine) readers,
The second patch makes use of it and fixes mirror thin writing. Fam Zheng (2): block: Introduce coroutine lock to dirty bitmap mirror: Improve zero-write and discard with fragmented image block.c | 26 ++++++-- block/mirror.c | 160 ++++++++++++++++++++++++++++++++++++---------- include/block/block.h | 6 +- include/block/block_int.h | 4 +- 4 files changed, 156 insertions(+), 40 deletions(-) -- 2.4.3