Am 15.07.2019 um 12:45 hat Max Reitz geschrieben: > If a qcow2 file is preallocated, it can no longer guarantee that it > initially appears as filled with zeroes. > > So implement .bdrv_has_zero_init() by checking whether the file is > preallocated; if so, forward the call to the underlying storage node, > except for when it is encrypted: Encrypted preallocated images always > return effectively random data, so .bdrv_has_zero_init() must always > return 0 for them. > > Reported-by: Stefano Garzarella <sgarz...@redhat.com> > Signed-off-by: Max Reitz <mre...@redhat.com>
Hm... This patch only really works directly after image creation (which is indeed where .bdrv_has_zero_init is used). Why do we have to have a full qcow2_is_zero() that loops over the whole image just to find out whether it's preallocated? Wouldn't looking at a single data cluster be enough? Kevin