>> Create a qcow2 directly on bare block device with >> "-o preallocation=metadata" option. When read this qcow2, it will >> return pre-existing data on block device, and this may lead to >> data leakage. This patch add QCOW_OFLAG_ZERO for all preallocated >> l2 entry to avoid this problem. > > This is a semantic change; are we okay making it?
> Does your code properly check for qcow2v2 files, which don't support > QCOW_OFLAG_ZERO (only qcow2v3 supports it)? Sorry for this mistake. Current solution can only be used with s->qcow_version >= 3. I'll fix it. On Fri, May 11, 2018 at 9:41 PM Eric Blake <ebl...@redhat.com> wrote: > On 05/11/2018 07:37 AM, Ivan Ren wrote: > > Create a qcow2 directly on bare block device with > > "-o preallocation=metadata" option. When read this qcow2, it will > > return pre-existing data on block device, and this may lead to > > data leakage. This patch add QCOW_OFLAG_ZERO for all preallocated > > l2 entry to avoid this problem. > > This is a semantic change; are we okay making it? > > Does your code properly check for qcow2v2 files, which don't support > QCOW_OFLAG_ZERO (only qcow2v3 supports it)? > > > > > Signed-off-by: Ivan Ren <ivan...@tencent.com> > > --- > > -- > Eric Blake, Principal Software Engineer > Red Hat, Inc. +1-919-301-3266 > Virtualization: qemu.org | libvirt.org >