From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59827) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bonwt-0006m3-G1 for qemu-devel@nongnu.org; Tue, 27 Sep 2016 04:41:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bonwr-0002dg-MQ for qemu-devel@nongnu.org; Tue, 27 Sep 2016 04:41:10 -0400 Date: Tue, 27 Sep 2016 10:41:02 +0200 From: Kevin Wolf Message-ID: <20160927084102.GF4090@noname.str.redhat.com> References: <1474942834-19700-1-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1474942834-19700-1-git-send-email-famz@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: Fam Zheng Cc: qemu-devel@nongnu.org, Max Reitz , qemu-block@nongnu.org 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. Kevin