aboutsummaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/051
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2019-03-11 16:13:16 +0100
committerKevin Wolf <kwolf@redhat.com>2019-03-12 20:30:14 +0100
commit30855137783c0c762007044821a6f11e14e6af33 (patch)
treed30b921270e23e1d0852e0c18533c7967be4add6 /tests/qemu-iotests/051
parent69b736e76567ecbc9b9e55570bc0afc840614a98 (diff)
downloadqemu-30855137783c0c762007044821a6f11e14e6af33.zip
qemu-30855137783c0c762007044821a6f11e14e6af33.tar.gz
qemu-30855137783c0c762007044821a6f11e14e6af33.tar.bz2
file-posix: Fix bdrv_open_flags() for snapshot=on
Using a different read-only setting for bs->open_flags than for the flags to the driver's open function is just inconsistent and a bad idea. After this patch, the temporary snapshot keeps being opened read-only if read-only=on,snapshot=on is passed. If we wanted to change this behaviour to make only the orginal image file read-only, but the temporary overlay read-write (as the comment in the removed code suggests), that change would have to be made in bdrv_temp_snapshot_options() (where the comment suggests otherwise). Addressing this inconsistency before introducing dynamic auto-read-only is important because otherwise we would immediately try to reopen the temporary overlay even though the file is already unlinked. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/051')
-rwxr-xr-xtests/qemu-iotests/0517
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051
index 3b50c7f..6a3b7c2 100755
--- a/tests/qemu-iotests/051
+++ b/tests/qemu-iotests/051
@@ -356,6 +356,13 @@ $QEMU_IO -c "read -P 0x33 0 4k" "$TEST_IMG" | _filter_qemu_io
# Using snapshot=on with a non-existent TMPDIR
TMPDIR=/nonexistent run_qemu -drive driver=null-co,snapshot=on
+# Using snapshot=on together with read-only=on
+echo "info block" |
+ run_qemu -drive file="$TEST_IMG",snapshot=on,read-only=on,if=none,id=$device_id |
+ _filter_qemu_io |
+ sed -e 's#"/[^"]*/vl\.[A-Za-z0-9]\{6\}"#SNAPSHOT_PATH#g'
+
+
# success, all done
echo "*** done"
rm -f $seq.full