summary refs log tree commit diff stats
path: root/scripts/simplebench/bench_write_req.py
diff options
context:
space:
mode:
authorAlberto Garcia <berto@igalia.com>2020-09-11 16:09:41 +0200
committerMax Reitz <mreitz@redhat.com>2020-09-15 11:30:36 +0200
commit8e958260c5a562f3be08beef2055975c04836200 (patch)
tree285ff3263c213a71f082f2907f6b36a815a104c5 /scripts/simplebench/bench_write_req.py
parentc1dadda02ca62823d5ee21dc6435d593c3993d32 (diff)
downloadfocaccia-qemu-8e958260c5a562f3be08beef2055975c04836200.tar.gz
focaccia-qemu-8e958260c5a562f3be08beef2055975c04836200.zip
qcow2: Make preallocate_co() resize the image to the correct size
This function preallocates metadata structures and then extends the
image to its new size, but that new size calculation is wrong because
it doesn't take into account that the host_offset variable is always
cluster-aligned.

This problem can be reproduced with preallocation=metadata when the
original size is not cluster-aligned but the new size is. In this case
the final image size will be shorter than expected.

   qemu-img create -f qcow2 img.qcow2 31k
   qemu-img resize --preallocation=metadata img.qcow2 128k

Signed-off-by: Alberto Garcia <berto@igalia.com>
Message-Id: <adeb8b059917b141d5f5b3bd2a016262d3052c79.1599833007.git.berto@igalia.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
[mreitz: Mark compat=0.10 unsupported for iotest 125]
Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'scripts/simplebench/bench_write_req.py')
0 files changed, 0 insertions, 0 deletions