On Thursday, 2020-01-16 at 15:37:22 +01, Max Reitz wrote: > So I suppose the best idea I can come up with is indeed a > --target-is-zero flag for qemu-img convert -n. Would that work for you?
I was looking at adding this for a slightly different reason (converting sparse images to newly provisioned LUNs). Followup is a naive patch (I'm new to hacking on qemu and the block layer seems complex due to maturity) that works in my tests. Feedback much appreciated. The patch specifically targets the initial blanking of the image rather than any other attempt to write zeroes, as I couldn't convince myself that there was no control flow where qemu-img convert might need to overwrite (with zeroes) data that it itself had previously written. dme. -- Stop the music and go home.