mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Add discard_no_unref option for qcow2 images
Qemu 8.1.0 will add discard_no_unref option for qcow2 images. When this option is enabled (default=false), then it will no longer unreference clusters when guest does a discard, but it will just free the blocks (useful for incremental backups for example) and pass the discard to the lower layer. This was implemented to avoid fragmentation within the qcow2 image. Signed-off-by: Jean-Louis Dupond <jean-louis@dupond.be> Reviewed-by: Peter Krempa <pkrempa@redhat.com> Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
committed by
Peter Krempa
parent
1092a88e13
commit
b855f8ea1e
@@ -3284,6 +3284,13 @@ paravirtualized driver is specified via the ``disk`` element.
|
||||
format driver of the ``qemu`` hypervisor can be controlled via the
|
||||
``max_size`` subelement (see example below).
|
||||
|
||||
The optional ``discard_no_unref`` attribute can be set to control the way
|
||||
the ``qemu`` hypervisor handles guest discard commands inside the qcow2
|
||||
image. When enabled, a discard request from within the guest will mark the
|
||||
qcow2 cluster as zero, but will keep the reference/offset of that cluster.
|
||||
But it will still pass the discard further to the lower layer.
|
||||
This will resolve fragmentation within the qcow2 image. :since:`Since 9.5.0`
|
||||
|
||||
In the majority of cases the default configuration used by the hypervisor
|
||||
is sufficient so modifying this setting should not be necessary. For
|
||||
specifics on how the metadata cache of ``qcow2`` in ``qemu`` behaves refer
|
||||
|
||||
Reference in New Issue
Block a user