From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50773) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XLaoJ-0001iK-Me for qemu-devel@nongnu.org; Sun, 24 Aug 2014 12:38:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XLaoC-00089g-OS for qemu-devel@nongnu.org; Sun, 24 Aug 2014 12:38:31 -0400 Received: from mail-pd0-x230.google.com ([2607:f8b0:400e:c02::230]:55488) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XLaoC-00089J-HD for qemu-devel@nongnu.org; Sun, 24 Aug 2014 12:38:24 -0400 Received: by mail-pd0-f176.google.com with SMTP id y10so18839275pdj.21 for ; Sun, 24 Aug 2014 09:38:22 -0700 (PDT) Message-ID: <53FA14EE.2060104@gmail.com> Date: Mon, 25 Aug 2014 00:38:06 +0800 From: Jun Li MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] qcow2: Add bdrv_discard support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: kwolf@redhat.com, stefanha@redhat.com Cc: qemu-devel@nongnu.org Hi Kevin and Stefan, As the realize of bdrv_discard, and this patch has been received, but I have some question. This adds a bdrv_discard function to qcow2 that frees the discarded clusters. It does not yet pass the discard on to the underlying file system driver, but the space can be reused by future writes to the image. Above content is on url: https://lists.gnu.org/archive/html/qemu-devel/2011-01/msg03100.html I have following question: Why bdrv_discard does not yet pass the discard on to the underlying file system driver? And this exist a potential issue: host cluster leak for qcow2. As qcow2 image can be created on RAW disk, so this is not just "does not yet pass the discard on to the underlying file system driver". Could you give some explanation why do not realize this function? Thx. As I am trying to realize qcow2 shrinking, but hit bdrv_discard can not release the free cluster on host. Best Regards, Jun Li