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 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.

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=on or discard=unmap
options.

Stefan

Attachment: pgpTFEuH0KVho.pgp
Description: PGP signature

Reply via email to