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

2015-05-19 Thread Paolo Bonzini
On 19/05/2015 13:49, Fam Zheng wrote: When block job mirror is finished, the source and target is synced. But we call bdrv_swap() later in main loop bh. If the guest write before that, target will not get the new data. This is too late. As a rule, the blocker must be established before

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

2015-05-19 Thread Fam Zheng
On Tue, 05/19 10:04, Paolo Bonzini wrote: On 19/05/2015 13:49, Fam Zheng wrote: When block job mirror is finished, the source and target is synced. But we call bdrv_swap() later in main loop bh. If the guest write before that, target will not get the new data. This is too late. As a

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

2015-05-19 Thread Paolo Bonzini
On 19/05/2015 18:48, Fam Zheng wrote: This is too late. As a rule, the blocker must be established before calling bdrv_drain, and removed on the next yield (in this case, before the assignment to last_pause_ns). I don't understand. If the blocker is removed before mirror_run returns,

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

2015-05-18 Thread Fam Zheng
When block job mirror is finished, the source and target is synced. But we call bdrv_swap() later in main loop bh. If the guest write before that, target will not get the new data. Reported-by: Wen Congyang we...@cn.fujitsu.com Signed-off-by: Fam Zheng f...@redhat.com --- block/mirror.c | 8