From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58046) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ypvyj-0004G0-Oa for qemu-devel@nongnu.org; Wed, 06 May 2015 05:50:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ypvyi-00025k-T5 for qemu-devel@nongnu.org; Wed, 06 May 2015 05:50:57 -0400 Date: Wed, 6 May 2015 17:50:48 +0800 From: Fam Zheng Message-ID: <20150506095048.GA9991@ad.nay.redhat.com> References: <1430830009-29839-1-git-send-email-famz@redhat.com> <1430830009-29839-2-git-send-email-famz@redhat.com> <5548C071.1050805@redhat.com> <20150506014533.GA9341@fam-t430.nay.redhat.com> <5549D809.5070804@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5549D809.5070804@redhat.com> Subject: Re: [Qemu-devel] [PATCH 1/4] block: Fix dirty bitmap in bdrv_co_discard List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Kevin Wolf , qemu-block@nongnu.org, qemu-devel@nongnu.org, Stefan Hajnoczi , jsnow@redhat.com, wangxiaolong@ucloud.cn On Wed, 05/06 10:59, Paolo Bonzini wrote: > > > On 06/05/2015 03:45, Fam Zheng wrote: > >> > This is not enough, you also have to do the discard in block/mirror.c, > >> > otherwise the destination image could even become fully provisioned! > > I wasn't sure what if src and dest have different can_write_zeroes_with_unmap > > value, but your argument is stronger. > > > > I will add discard in mirror. Besides that, do we need to compare the > > can_write_zeroes_with_unmap? > > Hmm, if can_write_zeroes_with_unmap is set, it's probably better to > write zeroes instead of discarding, in case the guest is relying on it. > I think there are four cases: # src can_write_zeroes_with_unmap target can_write_zeroes_with_unmap -------------------------------------------------------------------------------- 1 true true 2 true false 3 false true 4 false false I think replicating discard only works for 1, because both side would then read 0. For case 2 & 3 it's probably better to mirror the actual reading of source. I'm not sure about 4. What do you think? Fam