summaryrefslogtreecommitdiffstats
path: root/tests/qemu-iotests/102
diff options
context:
space:
mode:
authorPavel Butsykin2017-09-18 14:42:27 +0200
committerMax Reitz2017-09-26 15:00:32 +0200
commit4ffca8904a350460cdaa6304ea8c9b9c693d2d91 (patch)
tree3d7c0d764d18334222c11e84dc8a081361ada1b6 /tests/qemu-iotests/102
parentiotests: fix 181: enable postcopy-ram capability on target (diff)
downloadqemu-4ffca8904a350460cdaa6304ea8c9b9c693d2d91.tar.gz
qemu-4ffca8904a350460cdaa6304ea8c9b9c693d2d91.tar.xz
qemu-4ffca8904a350460cdaa6304ea8c9b9c693d2d91.zip
qemu-img: add --shrink flag for resize
The flag is additional precaution against data loss. Perhaps in the future the operation shrink without this flag will be blocked for all formats, but for now we need to maintain compatibility with raw. Signed-off-by: Pavel Butsykin <pbutsykin@virtuozzo.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20170918124230.8152-2-pbutsykin@virtuozzo.com [mreitz: Added a missing space to a warning] Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/102')
-rwxr-xr-xtests/qemu-iotests/1024
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/qemu-iotests/102 b/tests/qemu-iotests/102
index 87db1bb1bf..d7ad8d9840 100755
--- a/tests/qemu-iotests/102
+++ b/tests/qemu-iotests/102
@@ -54,7 +54,7 @@ _make_test_img $IMG_SIZE
$QEMU_IO -c 'write 0 64k' "$TEST_IMG" | _filter_qemu_io
# Remove data cluster from image (first cluster: image header, second: reftable,
# third: refblock, fourth: L1 table, fifth: L2 table)
-$QEMU_IMG resize -f raw "$TEST_IMG" $((5 * 64 * 1024))
+$QEMU_IMG resize -f raw --shrink "$TEST_IMG" $((5 * 64 * 1024))
$QEMU_IO -c map "$TEST_IMG"
$QEMU_IMG map "$TEST_IMG"
@@ -69,7 +69,7 @@ $QEMU_IO -c 'write 0 64k' "$TEST_IMG" | _filter_qemu_io
qemu_comm_method=monitor _launch_qemu -drive if=none,file="$TEST_IMG",id=drv0
-$QEMU_IMG resize -f raw "$TEST_IMG" $((5 * 64 * 1024))
+$QEMU_IMG resize -f raw --shrink "$TEST_IMG" $((5 * 64 * 1024))
_send_qemu_cmd $QEMU_HANDLE 'qemu-io drv0 map' 'allocated' \
| sed -e 's/^(qemu).*qemu-io drv0 map...$/(qemu) qemu-io drv0 map/'