On Fri, Nov 14, 2025 at 10:45:12PM +0100, Andrea Bolognani wrote:
> On Fri, Nov 14, 2025 at 02:33:20AM -0500, zrm wrote:
> > Here's the other one:
> >
> > # 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",
> >
> > This one isn't an issue for snapshot deletion or blockcommit. But if you
> > actually wanted detect_zeroes='unmap' in the active top image, creating a
> > snapshot turns it off until you shut down the VM because
> > qemuDomainPrepareDiskSourceData() isn't properly copying the detect_zeroes
> > property to the new top image during snapshot creation. In theory qemu could
> > also deduce that one without being told if it gets a new top image when
> > detect_zeroes was enabled for the previous one, but it isn't doing that even
> > in sid and even if it was that would still leave the "detect_zeroes" field
> > in "struct _virStorageSource" set to the wrong value for the new top image
> > in libvirt.
> >
> > I suppose that one wants to be a separate bug at this point, doesn't it?
>
> This is currently being looked at. I'll keep you posted.It has now been fixed upstream with commit 475ed7075d400347f7e1b0f49ce1d1a39798ef99 Author: Peter Krempa <[email protected]> Date: Fri Nov 14 16:05:06 2025 +0100 qemuDomainPrepareDiskSourceData: Setup 'detect_zeroes' for all layers While it may seem that zero detection is pointless for backing chain layers other than the top one, which is usually the only one gettin written to, with block operations such as active-layer commit the non-top layer may become active, in which case the VM wouldn't be configured in accordance to the XML any more. Similarly with snapshots a new image is introduced which would not get zero detection enabled, but next start of the VM would enable it. Fix this by propagating the zero detection setting for all layers. This problem partially addresses one of the issues reported in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1120389 Fixes: 8a78f88a1a6 and a522c3044bd (effectively reverts them) Signed-off-by: Peter Krempa <[email protected]> Reviewed-by: Ján Tomko <[email protected]> Reviewed-by: Andrea Bolognani <[email protected]> https://gitlab.com/libvirt/libvirt/-/commit/475ed7075d400347f7e1b0f49ce1d1a39798ef99 I'll backport it shortly. Can you please file a separate bug for it so that things are tracked correctly? -- Andrea Bolognani <[email protected]> Resistance is futile, you will be garbage collected.
signature.asc
Description: PGP signature

