Re: [PATCH v2 0/5] fix & merge block_status_above and is_allocated_above

2020-05-19 Thread Vladimir Sementsov-Ogievskiy

19.05.2020 23:21, Eric Blake wrote:

On 5/19/20 2:54 PM, Vladimir Sementsov-Ogievskiy wrote:


This leads to the following effect:

./qemu-img create -f qcow2 base.qcow2 2M
./qemu-io -c "write -P 0x1 0 2M" base.qcow2

./qemu-img create -f qcow2 -b base.qcow2 mid.qcow2 1M
./qemu-img create -f qcow2 -b mid.qcow2 top.qcow2 2M

Region 1M..2M is shadowed by short middle image, so guest sees zeroes:
./qemu-io -c "read -P 0 1M 1M" top.qcow2
read 1048576/1048576 bytes at offset 1048576
1 MiB, 1 ops; 00.00 sec (22.795 GiB/sec and 23341.5807 ops/sec)

But after commit guest visible state is changed, which seems wrong for me:
./qemu-img commit top.qcow2 -b mid.qcow2

./qemu-io -c "read -P 0 1M 1M" mid.qcow2
Pattern verification failed at offset 1048576, 1048576 bytes
read 1048576/1048576 bytes at offset 1048576
1 MiB, 1 ops; 00.00 sec (4.981 GiB/sec and 5100.4794 ops/sec)


This no longer happens as of commit bf03dede47 and friends.  As such, how much 
of this series is still needed for other reasons?



Oops sorry. I blindly copied cover-letter of v1, and forget that it describes 
another thing. This test above is unrelated now. The whole series is valid, it 
fixes another problem (see 04 and new test cases in 05).

--
Best regards,
Vladimir



Re: [PATCH v2 0/5] fix & merge block_status_above and is_allocated_above

2020-05-19 Thread Eric Blake

On 5/19/20 2:54 PM, Vladimir Sementsov-Ogievskiy wrote:


This leads to the following effect:

./qemu-img create -f qcow2 base.qcow2 2M
./qemu-io -c "write -P 0x1 0 2M" base.qcow2

./qemu-img create -f qcow2 -b base.qcow2 mid.qcow2 1M
./qemu-img create -f qcow2 -b mid.qcow2 top.qcow2 2M

Region 1M..2M is shadowed by short middle image, so guest sees zeroes:
./qemu-io -c "read -P 0 1M 1M" top.qcow2
read 1048576/1048576 bytes at offset 1048576
1 MiB, 1 ops; 00.00 sec (22.795 GiB/sec and 23341.5807 ops/sec)

But after commit guest visible state is changed, which seems wrong for me:
./qemu-img commit top.qcow2 -b mid.qcow2

./qemu-io -c "read -P 0 1M 1M" mid.qcow2
Pattern verification failed at offset 1048576, 1048576 bytes
read 1048576/1048576 bytes at offset 1048576
1 MiB, 1 ops; 00.00 sec (4.981 GiB/sec and 5100.4794 ops/sec)


This no longer happens as of commit bf03dede47 and friends.  As such, 
how much of this series is still needed for other reasons?


--
Eric Blake, Principal Software Engineer
Red Hat, Inc.   +1-919-301-3226
Virtualization:  qemu.org | libvirt.org