]> xenbits.xensource.com Git - libvirt.git/commit
Add discard_no_unref option for qcow2 images
authorJean-Louis Dupond <jean-louis@dupond.be>
Fri, 9 Jun 2023 10:47:36 +0000 (12:47 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 26 Jun 2023 11:06:00 +0000 (13:06 +0200)
commitb855f8ea1e01a7858a48f82351b391e2aed7b53f
tree251d8bcb9ae0cbc9acb4d9363f75d472baa1bfac
parent1092a88e1380dd1625fd2b9ab106edf5f76f7fe1
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>
17 files changed:
docs/formatdomain.rst
src/conf/domain_conf.c
src/conf/domain_conf.h
src/conf/domain_validate.c
src/conf/schemas/domaincommon.rng
src/conf/storage_source_conf.c
src/conf/storage_source_conf.h
src/qemu/qemu_block.c
src/qemu/qemu_domain.c
src/qemu/qemu_driver.c
src/qemu/qemu_validate.c
src/vz/vz_utils.c
tests/qemuxml2argvdata/disk-discard_no_unref.x86_64-latest.args [new file with mode: 0644]
tests/qemuxml2argvdata/disk-discard_no_unref.xml [new file with mode: 0644]
tests/qemuxml2argvtest.c
tests/qemuxml2xmloutdata/disk-discard_no_unref.x86_64-latest.xml [new file with mode: 0644]
tests/qemuxml2xmltest.c