On 28.07.20 13:35, Paolo Bonzini wrote: > On 28/07/20 13:33, Vladimir Sementsov-Ogievskiy wrote: >>> Thanks for both your investigation. Does the attached patch help? >> >> For me, the reproducer is fixed with your patch. > > Is it possible to make a quick testcase using qemu-io?
This seems to work: $ qemu-img create -f qcow2 -o cluster_size=512 base.qcow2 512 $ qemu-img create -f qcow2 -o cluster_size=512 -F qcow2 -b base.qcow2 \ top.qcow2 1024 $ qemu-io -c 'write -P 42 0 512' top.qcow2 $ qemu-io -c 'read -v 0 1024' top.qcow2 That should print 512 times “2a” and then 512 times “00”, but beyond 512, the buffer stays uninitialized; instead, the first 512 bytes are zeroed. (With the patch, it works as expected.)
signature.asc
Description: OpenPGP digital signature