From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42375) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMdy6-0003gh-Qr for qemu-devel@nongnu.org; Wed, 27 Aug 2014 10:13:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMdxx-0002Hf-Q8 for qemu-devel@nongnu.org; Wed, 27 Aug 2014 10:12:58 -0400 Received: from mail-wi0-x22b.google.com ([2a00:1450:400c:c05::22b]:38466) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMdxx-0002HP-Id for qemu-devel@nongnu.org; Wed, 27 Aug 2014 10:12:49 -0400 Received: by mail-wi0-f171.google.com with SMTP id hi2so5901720wib.4 for ; Wed, 27 Aug 2014 07:12:47 -0700 (PDT) Date: Wed, 27 Aug 2014 15:12:42 +0100 From: Stefan Hajnoczi Message-ID: <20140827141242.GQ8280@stefanha-thinkpad.redhat.com> References: <53FA14EE.2060104@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mzmkN2k+aDjaU9Rr" Content-Disposition: inline In-Reply-To: <53FA14EE.2060104@gmail.com> Subject: Re: [Qemu-devel] [PATCH v2] qcow2: Add bdrv_discard support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jun Li Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com --mzmkN2k+aDjaU9Rr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 25, 2014 at 12:38:06AM +0800, Jun Li wrote: > 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 f= ile > system driver". Could you give some explanation why do not realize this > function? Thx. >=20 > As I am trying to realize qcow2 shrinking, but hit bdrv_discard can not > release the free cluster on host. qcow2 is capable of passing discards down to the image file. See qcow2_process_discards(). It is important that s->discard_passthrough[QCOW2_DISCARD_REQUEST] is true! Make sure to use the pass-discard-request=3Don or discard=3Dunmap options. Stefan --mzmkN2k+aDjaU9Rr Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJT/edaAAoJEJykq7OBq3PIGhkH/RYoRew6ncs+J/PZr+GUmL07 Wa3WzIgivJaunudtBNQilJaAbZNfQ/PGCxysKIAVMHsT3mL6Nc5psg0RSddCpcvJ 9V0e4zaFOfcKhsSCDSA8k3+lhLsy4nJo9GjuTnD175J4FNHmBA6h34wAdQNPADaQ opJurrF6RRbx5e2fUzAMv9K8dG/NspDdRV0lmm5+LZF2/1mKw1z60OO8D6Fx6LbW f6SRp2oizchPZm5aR8/ARvr0L7CiAxYAGWF16c3PNV+kad9MSfC5WcJuWUuD7iuu O48m9WGnQotrK1eOKBnKA8kyNofn6BtGGUIxvx/4FkxnXILhwAicRqnCso7wL9E= =uV4z -----END PGP SIGNATURE----- --mzmkN2k+aDjaU9Rr--