Lines Matching +full:read +full:- +full:only
50 if $QEMU_IMG_PROG info --image-opts "driver=file,locking=on,filename=$TEST_IMG" 2>&1 |
51 grep -q 'falling back to POSIX file'; then
72 if ! test -t 0; then
73 while read cmd; do
78 ) | $QEMU -nographic -monitor stdio -serial none "$@" 1>/dev/null
84 $(for i in $@; do echo "-drive if=none,file=$i"; done) 2>&1 \
88 echo "== readonly=off,force-share=on should be rejected =="
89 _run_qemu_with_images null-co://,readonly=off,force-share=on
91 for opts1 in "" "read-only=on" "read-only=on,force-share=on"; do
98 _make_test_img -b "${TEST_IMG}.base" -F $IMGFMT
102 _launch_qemu -drive file="${TEST_IMG}",if=none,$opts1
105 for opts2 in "" "read-only=on" "read-only=on,force-share=on"; do
109 $QEMU -nographic -monitor stdio \
110 -drive file="${TEST_IMG}",if=none,$opts2 2>&1 1>/dev/null | \
114 for L in "" "-U"; do
118 _run_cmd $QEMU_IO $L -c "read 0 512" "${TEST_IMG}"
119 _run_cmd $QEMU_IO $L -r -c "read 0 512" "${TEST_IMG}"
120 _run_cmd $QEMU_IO -c "open $L ${TEST_IMG}" -c "read 0 512"
121 _run_cmd $QEMU_IO -c "open -r $L ${TEST_IMG}" -c "read 0 512"
126 _run_cmd $QEMU_IMG amend -o "size=$size" $L "${TEST_IMG}"
129 _run_cmd $QEMU_IMG rebase $L "${TEST_IMG}" -b "${TEST_IMG}.base" -F $IMGFMT
130 _run_cmd $QEMU_IMG snapshot -l $L "${TEST_IMG}"
133 _run_cmd $QEMU_IMG bench $L -c 1 "${TEST_IMG}"
134 _run_cmd $QEMU_IMG bench $L -w -c 1 "${TEST_IMG}"
136 # qemu-img create does not support -U
137 if [ -z "$L" ]; then
138 _run_cmd $QEMU_IMG create -f $IMGFMT "${TEST_IMG}" \
139 -b ${TEST_IMG}.base -F $IMGFMT
140 # Read the file format. It used to be the case that
141 # file-posix simply truncated the file, but the qcow2
147 # So we read it here to see that creation either completed
151 _img_info -U | grep 'file format'
160 test_opts="read-only=off read-only=on read-only=on,force-share=on"
164 echo "== Two devices with the same image ($opt1 - $opt2) =="
171 $QEMU_IMG create -f qcow2 "${TEST_IMG}.a" -b "${TEST_IMG}" -F $IMGFMT | _filter_img_create
172 $QEMU_IMG create -f qcow2 "${TEST_IMG}.b" -b "${TEST_IMG}" -F $IMGFMT | _filter_img_create
173 $QEMU_IMG create -f qcow2 "${TEST_IMG}.c" -b "${TEST_IMG}.b" -F $IMGFMT \
191 rm -f "${TEST_IMG}.lnk" &>/dev/null
192 ln -s ${TEST_IMG} "${TEST_IMG}.lnk" || echo "Failed to create link"
197 _launch_qemu -drive format=$IMGFMT,file="${TEST_IMG}.a",id=drive0,if=none \
198 -device virtio-blk,drive=drive0
203 _run_cmd $QEMU_IMG commit -b "${TEST_IMG}.b" "${TEST_IMG}.c"
215 "{ 'execute': 'human-monitor-command',
216 'arguments': { 'command-line': 'drive_add 0 if=none,id=d0,file=${TEST_IMG}' } }" \
219 _run_cmd $QEMU_IO "${TEST_IMG}" -c 'write 0 512'
221 echo "Creating overlay with qemu-img when the guest is running should be allowed"
222 _run_cmd $QEMU_IMG create -f $IMGFMT -b "${TEST_IMG}" -F $IMGFMT "${TEST_IMG}.overlay"
226 "{ 'execute': 'human-monitor-command',
227 'arguments': { 'command-line': 'drive_del d0' } }" \
230 _run_cmd $QEMU_IO "${TEST_IMG}" -c 'write 0 512'
235 "{ 'execute': 'human-monitor-command',
236 … 'arguments': { 'command-line': 'drive_add 0 if=none,id=$d,file=${TEST_IMG},readonly=on' } }" \
243 "{ 'execute': 'human-monitor-command',
244 'arguments': { 'command-line': 'drive_del d0' } }" \
247 _run_cmd $QEMU_IO "${TEST_IMG}" -c 'write 0 512'
251 "{ 'execute': 'human-monitor-command',
252 'arguments': { 'command-line': 'drive_del d1' } }" \
255 _run_cmd $QEMU_IO "${TEST_IMG}" -c 'write 0 512'
260 echo "== Detecting -U and force-share conflicts =="
264 $QEMU_IMG info -U --image-opts driver=null-co,force-share=on
267 $QEMU_IMG info -U --image-opts driver=null-co,force-share=off
271 $QEMU_IO -c 'open -r -U -o driver=null-co,force-share=on'
274 $QEMU_IO -c 'open -r -U -o driver=null-co,force-share=off'
278 rm -f $seq.full