fi
reference=$seq.out
- if (echo $QEMU_IO_OPTIONS | grep -s -- '--nocache' > /dev/null); then
+ if [ "$CACHEMODE" = "none" ]; then
[ -f $seq.out.nocache ] && reference=$seq.out.nocache
fi
have_test_arg=false
randomize=false
valgrind=false
+cachemode=false
rm -f $tmp.list $tmp.tmp $tmp.sed
export IMGFMT=raw
export IMGFMT_GENERIC=true
export IMGPROTO=file
export IMGOPTS=""
+export CACHEMODE="writethrough"
export QEMU_IO_OPTIONS=""
+export CACHEMODE_IS_DEFAULT=true
for r
do
IMGOPTS="$r"
imgopts=false
continue
-
+ elif $cachemode
+ then
+ CACHEMODE="$r"
+ CACHEMODE_IS_DEFAULT=false
+ cachemode=false
+ continue
fi
xpand=true
-o options -o options to pass to qemu-img create/convert
-T output timestamps
-r randomize test order
+ -c mode cache mode
testlist options
-g group[,group...] include tests from these groups
xpand=false
;;
-nocache)
- QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS --nocache"
+ CACHEMODE="none"
+ CACHEMODE_IS_DEFAULT=false
xpand=false
;;
imgopts=true
xpand=false
;;
+ -c)
+ cachemode=true
+ xpand=false
+ ;;
-r) # randomize test order
randomize=true
xpand=false
done
+# Set qemu-io cache mode with $CACHEMODE we have
+QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS --cache $CACHEMODE"
+
# Set default options for qemu-img create -o if they were not specified
_set_default_imgopts