On Fri 27 Mar 2020 07:57:40 PM CET, Eric Blake wrote: >> + /* If the image does not support QCOW_OFLAG_ZERO then discarding >> + * clusters could expose stale data from the backing file. */ >> + if (s->qcow_version < 3 && bs->backing) { >> + return -ENOTSUP; >> + } > > Hmm. Should we blindly always fail for v2, or can we be a little bit > smarter and still discard a cluster in the top layer if the backing > layer does not also have it allocated?
Not sure if that's worth it. I only wanted to fix what looks like a potential security bug so I prefer to keep it simple. qcow2 v3 has been out for many years already. Berto