From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36892) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1booF8-0005NL-Si for qemu-devel@nongnu.org; Tue, 27 Sep 2016 05:00:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1booF7-00023Q-2d for qemu-devel@nongnu.org; Tue, 27 Sep 2016 05:00:01 -0400 Date: Tue, 27 Sep 2016 16:59:51 +0800 From: Fam Zheng Message-ID: <20160927085951.GA13510@lemon> References: <1474942834-19700-1-git-send-email-famz@redhat.com> <20160927084102.GF4090@noname.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160927084102.GF4090@noname.str.redhat.com> Subject: Re: [Qemu-devel] [PATCH] qemu-img: Allow unmap backing image for zeroed clusters List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org, Max Reitz , qemu-block@nongnu.org On Tue, 09/27 10:41, Kevin Wolf wrote: > Am 27.09.2016 um 04:20 hat Fam Zheng geschrieben: > > We already specified BDRV_O_UNMAP when opening images in 'qemu-img > > commit', but didn't turn on the "unmap" in the active commit job. This > > patch fixes that so that zeroed clusters in top image can be discarded > > which is desired in the virt-sparsify use case, where a temporary > > overlay is created and fstrim'ed before commiting back, to free space in > > the original image. > > > > The block-commit keeps the existing behavior. > > > > Signed-off-by: Fam Zheng > > Is there a good reason for not using discard in an active commit if the > image was opened with BDRV_O_UNMAP? That is, wouldn't it make sense to > just set the unmap option for the mirror unconditionally and also for > block-commit? > > If there is a reason, we should probably add an option to block-commit, > but I still feels that enabling it should be the default then. I didn't touch block-commit because I wasn't sure, but you made a good point, we can turn this on there too. Fam