So when you convert to the target image, you have to make sure all areas
that are zero in the source are zero in the target, too. The way we do
that is to write zeroes to the target. The problem is that this
operation disregards the previous preallocation and discards the
preallocated space.
As for fixing the bug... Can we fix it in qemu(-img)?
We could try to detect whether areas that are zero in the source are
zero in the (preallocated) target image, too. But doing so what require
reading the data from those areas and comparing it to zero. That would
take time and it isn’t trivial. So that’s something I’d rather avoid.