[Pkg-libvirt-maintainers] Bug#1121280: libvirt0: libvirt snapshot creation disables detect_zeroes
zrm
debbug at trustiosity.com
Mon Nov 24 01:30:20 GMT 2025
Package: libvirt0
Version: 11.3.0-3+deb13u1
Severity: normal
Tags: upstream
X-Debbugs-Cc: debbug at trustiosity.com
During snapshot creation in libvirt with qemu/kvm, the function
qemuDomainPrepareDiskSourceData() is called to copy properties into the
new top image for the snapshot. The function only copies the detect_zeroes property if the image is already the top image:
/* transfer properties valid only for the top level image */
if (src == disk->src || src == disk->src->dataFileStore)
src->detect_zeroes = disk->detect_zeroes;
The new image is about to be the top image, but it isn't yet at the time of
this function call, with the result that detect_zeroes remains as its default (off) and creating a snapshot causes it to be disabled in the running VM:
# grep -A3 "device='disk'" trogdor.xml
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' discard='unmap' detect_zeroes='unmap'/>
<source file='/var/lib/libvirt/images/trogdor.qcow2'/>
<target dev='vda' bus='virtio'/>
# virsh define trogdor.xml
Domain 'trogdor' defined from trogdor.xml
# virsh start trogdor
Domain 'trogdor' started
# virsh qemu-monitor-command trogdor --pretty
'{"execute":"query-block"}'|grep detect_zeroes
"detect_zeroes": "unmap",
# virsh snapshot-create-as --domain trogdor snap42 --diskspec
vda,file=/var/lib/libvirt/images/trogdor-snap42.qcow2 --disk-only
Domain snapshot snap42 created
# virsh qemu-monitor-command trogdor --pretty
'{"execute":"query-block"}'|grep detect_zeroes
"detect_zeroes": "off",
-- System Information:
Debian Release: 13.2
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 6.12.57+deb13-amd64 (SMP w/4 CPU threads; PREEMPT)
Kernel taint flags: TAINT_FIRMWARE_WORKAROUND
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages libvirt0 depends on:
ii libacl1 2.3.2-2+b1
ii libapparmor1 4.1.0-1
ii libaudit1 1:4.0.2-2+b2
ii libbsd0 0.12.2-2
ii libc6 2.41-12
ii libcap-ng0 0.8.5-4+b1
ii libcurl3t64-gnutls 8.14.1-2+deb13u2
ii libgcc-s1 14.2.0-19
ii libglib2.0-0t64 2.84.4-3~deb13u1
ii libgnutls30t64 3.8.9-3
ii libjson-c5 0.18+ds-1
ii libnl-3-200 3.7.0-2
ii libnuma1 2.0.19-1
ii libsasl2-2 2.1.28+dfsg1-9
ii libselinux1 3.8.1-1
ii libssh-4 0.11.2-1+deb13u1
ii libssh2-1t64 1.11.1-1
ii libtirpc3t64 1.3.6+ds-1
ii libvirt-common 11.3.0-3+deb13u1
ii libxml2 2.12.7+dfsg+really2.9.14-2.1+deb13u2
Versions of packages libvirt0 recommends:
ii libvirt-l10n 11.3.0-3+deb13u1
libvirt0 suggests no packages.
-- no debconf information
More information about the Pkg-libvirt-maintainers
mailing list