Lines Matching full:cache
3 # Test for configuring cache modes of arbitrary nodes (requires O_DIRECT)
43 # We test all cache modes anyway, but O_DIRECT needs to be supported
73 echo === Simple test for all cache modes ===
76 run_qemu -drive file="$TEST_IMG",cache=none
77 run_qemu -drive file="$TEST_IMG",cache=directsync
78 run_qemu -drive file="$TEST_IMG",cache=writeback
79 run_qemu -drive file="$TEST_IMG",cache=writethrough
80 run_qemu -drive file="$TEST_IMG",cache=unsafe
81 run_qemu -drive file="$TEST_IMG",cache=invalid_value
84 echo === Check inheritance of cache modes ===
92 # cache.direct is supposed to be inherited by both bs->file and
95 printf "cache.direct=on on none0\n"
96 …echo "$hmp_cmds" | run_qemu -drive "$files","$ids",cache.direct=on | grep -e "Cache" -e "[Cc]annot…
98 …echo "$hmp_cmds" | run_qemu -drive "$files","$ids",file.cache.direct=on | grep -e "Cache" -e "[Cc]…
100 …echo "$hmp_cmds" | run_qemu -drive "$files","$ids",backing.cache.direct=on | grep -e "Cache" -e "[…
102 … "$hmp_cmds" | run_qemu -drive "$files","$ids",backing.file.cache.direct=on | grep -e "Cache" -e "…
104 # cache.writeback is supposed to be inherited by bs->backing; bs->file
105 # always gets cache.writeback=on
108 …echo "$hmp_cmds" | run_qemu -drive "$files","$ids",cache.writeback=off | grep -e "Cache" -e "[Cc]a…
110 …echo "$hmp_cmds" | run_qemu -drive "$files","$ids",file.cache.writeback=off | grep -e "doesn't" -e…
112 …echo "$hmp_cmds" | run_qemu -drive "$files","$ids",backing.cache.writeback=off | grep -e "doesn't"…
114 …echo "$hmp_cmds" | run_qemu -drive "$files","$ids",backing.file.cache.writeback=off | grep -e "doe…
116 # cache.no-flush is supposed to be inherited by both bs->file and bs->backing
119 …echo "$hmp_cmds" | run_qemu -drive "$files","$ids",cache.no-flush=on | grep -e "Cache" -e "[Cc]ann…
121 …echo "$hmp_cmds" | run_qemu -drive "$files","$ids",file.cache.no-flush=on | grep -e "Cache" -e "[C…
123 …echo "$hmp_cmds" | run_qemu -drive "$files","$ids",backing.cache.no-flush=on | grep -e "Cache" -e …
125 …"$hmp_cmds" | run_qemu -drive "$files","$ids",backing.file.cache.no-flush=on | grep -e "Cache" -e …
129 echo "--- Configure cache modes on the command line ---"
132 # First check the inherited cache mode after opening the image.
143 echo "--- Cache modes after reopen (live snapshot) ---"
146 # Then trigger a reopen and check that the cache modes are still the same.
158 echo "--- Change cache modes with reopen (qemu-io command, flags) ---"
161 # This one actually changes the cache mode with the reopen. For this test, the
162 # new cache mode is specified in the flags, not as an option.
174 echo "--- Change cache modes with reopen (qemu-io command, options) ---"
177 # This one actually changes the cache mode with the reopen. For this test, the
178 # new cache mode is specified as an option, not in the flags.
180 hmp_cmds='qemu-io none0 "reopen -o cache.direct=on"
190 echo "--- Change cache modes after snapshot ---"
206 echo "--- Change cache mode in parent, child has explicit option in JSON ---"
216 hmp_cmds="qemu-io none0 \"reopen -o cache.direct=on,cache.no-flush=on\"
222 …me\":\"$TEST_IMG\",,\"cache\":{\"direct\":false}}",node-name=image,file.node-name=blkdebug,file.im…
235 # Check cache.direct
237 printf "cache.direct=on on blk\n"
238 …file" -drive "$drv_bk" -drive "$drv_file" -drive "$drv_img",cache.direct=on | grep -e "Cache" -e "…
240 … "$drv_bkfile" -drive "$drv_bk" -drive "$drv_file",cache.direct=on -drive "$drv_img" | grep -e "Ca…
242 …emu -drive "$drv_bkfile" -drive "$drv_bk",cache.direct=on -drive "$drv_file" -drive "$drv_img" | g…
244 … | run_qemu -drive "$drv_bkfile",cache.direct=on -drive "$drv_bk" -drive "$drv_file" -drive "$drv_…
246 # Check cache.writeback
249 …le" -drive "$drv_bk" -drive "$drv_file" -drive "$drv_img",cache.writeback=off | grep -e "Cache" -e…
251 …$drv_bkfile" -drive "$drv_bk" -drive "$drv_file",cache.writeback=off -drive "$drv_img" | grep -e "…
253 …u -drive "$drv_bkfile" -drive "$drv_bk",cache.writeback=off -drive "$drv_file" -drive "$drv_img" |…
255 … run_qemu -drive "$drv_bkfile",cache.writeback=off -drive "$drv_bk" -drive "$drv_file" -drive "$dr…
257 # Check cache.no-flush
260 …ile" -drive "$drv_bk" -drive "$drv_file" -drive "$drv_img",cache.no-flush=on | grep -e "Cache" -e …
262 …"$drv_bkfile" -drive "$drv_bk" -drive "$drv_file",cache.no-flush=on -drive "$drv_img" | grep -e "C…
264 …mu -drive "$drv_bkfile" -drive "$drv_bk",cache.no-flush=on -drive "$drv_file" -drive "$drv_img" | …
266 …| run_qemu -drive "$drv_bkfile",cache.no-flush=on -drive "$drv_bk" -drive "$drv_file" -drive "$drv…
270 echo "--- Configure cache modes on the command line ---"
273 # First check the inherited cache mode after opening the image.
283 echo "--- Cache modes after reopen (live snapshot) ---"
286 # Then trigger a reopen and check that the cache modes are still the same.
298 echo "--- Change cache modes with reopen (qemu-io command, flags) ---"
301 # This one actually changes the cache mode with the reopen. For this test, the
302 # new cache mode is specified as flags, not as option.
324 hmp_cmds='qemu-io none0 "reopen -o backing.cache.direct=on"
334 echo "--- Change cache mode after reopening child ---"
343 hmp_cmds="qemu-io none0 \"reopen -o file.cache.direct=off,file.cache.no-flush=off\"
344 qemu-io none0 \"reopen -o backing.file.cache.direct=off,backing.file.cache.no-flush=on\"
351 echo "$hmp_cmds" | run_qemu -drive "$files","$ids" | grep "Cache"
367 $QEMU_IO --cache=writeback -f file $TEST_IMG <<EOF | _filter_qemu_io
369 reopen -o cache.direct=on
371 reopen -o cache.direct=off
374 $QEMU_IO --cache=none -f file $TEST_IMG <<EOF | _filter_qemu_io
376 reopen -o cache.direct=off
378 reopen -o cache.direct=on