aboutsummaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/039
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2015-09-04 18:26:09 +0200
committerKevin Wolf <kwolf@redhat.com>2015-09-14 16:51:37 +0200
commite615053b1bd3e108a73958a54e3d0c5b965e15d3 (patch)
tree8490ba4787a85487354194987ac75eeda57fcded /tests/qemu-iotests/039
parent5b0959a7d432062dcd740f8065004285b15695fa (diff)
qemu-iotests: Reopen qcow2 with lazy-refcounts change
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/039')
-rwxr-xr-xtests/qemu-iotests/03927
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/qemu-iotests/039 b/tests/qemu-iotests/039
index 617f3977cc..9e9b379baa 100755
--- a/tests/qemu-iotests/039
+++ b/tests/qemu-iotests/039
@@ -147,6 +147,33 @@ $PYTHON qcow2.py "$TEST_IMG".base dump-header | grep incompatible_features
_check_test_img
TEST_IMG="$TEST_IMG".base _check_test_img
+echo
+echo "== Changing lazy_refcounts setting at runtime =="
+
+IMGOPTS="compat=1.1,lazy_refcounts=off"
+_make_test_img $size
+
+$QEMU_IO -c "reopen -o lazy-refcounts=on" \
+ -c "write -P 0x5a 0 512" \
+ -c "sigraise $(kill -l KILL)" "$TEST_IMG" 2>&1 \
+ | _filter_qemu_io
+
+# The dirty bit must be set
+$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features
+_check_test_img
+
+IMGOPTS="compat=1.1,lazy_refcounts=on"
+_make_test_img $size
+
+$QEMU_IO -c "reopen -o lazy-refcounts=off" \
+ -c "write -P 0x5a 0 512" \
+ -c "sigraise $(kill -l KILL)" "$TEST_IMG" 2>&1 \
+ | _filter_qemu_io
+
+# The dirty bit must not be set
+$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features
+_check_test_img
+
# success, all done
echo "*** done"