On 05/21/2015 09:40 PM, Fam Zheng wrote: > Unsetting dirty globally with discard is not very correct. The discard may zero > out sectors (depending on can_write_zeroes_with_unmap), we should replicate > this change to destinition side to make sure that the guest sees the same data. s/destinition/destination/ > > Calling bdrv_reset_dirty also troubles mirror job because the hbitmap iterator > doesn't expect unsetting of bits after current position. > > So let's do it the opposite way which fixes both problems: set the dirty bits > if we are to discard it. > > Reported-by: wangxiaolong@ucloud.cn > Signed-off-by: Fam Zheng > Reviewed-by: Paolo Bonzini > --- > block/io.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Eric Blake -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org