Re: [Qemu-block] [PATCH v5 13/13] block/mirror: Block device IO during mirror exit

2015-05-20 Thread Paolo Bonzini
On 20/05/2015 08:16, Fam Zheng wrote: static void mirror_exit(BlockJob *job, void *opaque) @@ -328,6 +330,8 @@ static void mirror_exit(BlockJob *job, void *opaque) MirrorExitData *data = opaque; AioContext *replace_aio_context = NULL; +bdrv_op_unblock(s-common.bs,

Re: [Qemu-block] [PATCH v5 13/13] block/mirror: Block device IO during mirror exit

2015-05-20 Thread Fam Zheng
On Wed, 05/20 08:32, Paolo Bonzini wrote: On 20/05/2015 08:16, Fam Zheng wrote: static void mirror_exit(BlockJob *job, void *opaque) @@ -328,6 +330,8 @@ static void mirror_exit(BlockJob *job, void *opaque) MirrorExitData *data = opaque; AioContext *replace_aio_context =

[Qemu-block] [PATCH v5 13/13] block/mirror: Block device IO during mirror exit

2015-05-20 Thread Fam Zheng
When mirror should complete, the source and target are in sync. But we call bdrv_swap() only a while later in the main loop bh. If the guest writes something before that, target will not get the new data. Block device IO before bdrv_drain and unblock it after bdrw_swap(). Reported-by: Wen