From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpalI-0003BO-39 for qemu-devel@nongnu.org; Thu, 29 Sep 2016 08:48:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bpalG-0006uz-9J for qemu-devel@nongnu.org; Thu, 29 Sep 2016 08:48:27 -0400 Date: Thu, 29 Sep 2016 14:48:15 +0200 From: Kevin Wolf Message-ID: <20160929124815.GL5742@noname.redhat.com> References: <1475046261-15679-1-git-send-email-famz@redhat.com> <20160929092917.GC5742@noname.redhat.com> <20160929095506.GD1118@lemon> <20160929103957.GG5742@noname.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH] qcow2: Support BDRV_REQ_MAY_UNMAP List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Fam Zheng , qemu-devel@nongnu.org, qemu-block@nongnu.org, Max Reitz Am 29.09.2016 um 14:14 hat Paolo Bonzini geschrieben: > On 29/09/2016 12:39, Kevin Wolf wrote: > >> > Because there is another check of pass-discard-request value in > >> > update_refcount: > >> > > >> > if (refcount == 0 && s->discard_passthrough[type]) { > >> > update_refcount_discard(bs, cluster_offset, s->cluster_size); > >> > } > > What I mean is that in the second case, you're still uselessly > > deallocating the cluster on the qcow2 level while you can't reclaim it > > on the filesystem level. So it would be better to leave it allocated in > > qcow2, too, so that you don't get an expensive reallocation the next > > time you write to it. > > But if you do a qemu-img convert, the deallocated cluster wouldn't be in > the destination. Right. I still think that there has to be an option to keep the image fully allocated. Perhaps what we really need to check is BDRV_O_UNMAP. Kevin