mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
iotests/221: Discard image before qemu-img map
See the new comment for why this should be done. I do not have a reproducer on master, but when using FUSE block exports, this test breaks depending on the underlying filesystem (for me, it works on tmpfs, but fails on xfs, because the block allocated by file-posix has 16 kB there instead of 4 kB). Suggested-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com> Message-Id: <20201207152245.66987-1-mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
eb43ea16dc
commit
f0947dc694
2 changed files with 13 additions and 8 deletions
|
@ -46,6 +46,13 @@ echo "=== Check mapping of unaligned raw image ==="
|
|||
echo
|
||||
|
||||
_make_test_img 65537 # qemu-img create rounds size up
|
||||
|
||||
# file-posix allocates the first block of any images when it is created;
|
||||
# the size of this block depends on the host page size and the file
|
||||
# system block size, none of which are constant. Discard the whole
|
||||
# image so we will not see this allocation in qemu-img map's output.
|
||||
$QEMU_IO -c 'discard 0 65537' "$TEST_IMG" | _filter_qemu_io
|
||||
|
||||
$QEMU_IMG map --output=json "$TEST_IMG" | _filter_qemu_img_map
|
||||
|
||||
truncate --size=65537 "$TEST_IMG" # so we resize it and check again
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue