mirror of https://github.com/xqemu/xqemu.git
qemu-iotests: Add "-c <cache-mode>" option
The option sets cache mode used in the tests. "-nocache" is changed to an alias to "-c none", and internally passes "-t none" to qemu-io. Python scripts will make use of option this in the next commit. Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
f8413b3c23
commit
3baa84491a
|
@ -242,7 +242,7 @@ do
|
||||||
fi
|
fi
|
||||||
|
|
||||||
reference=$seq.out
|
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
|
[ -f $seq.out.nocache ] && reference=$seq.out.nocache
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -42,13 +42,16 @@ expunge=true
|
||||||
have_test_arg=false
|
have_test_arg=false
|
||||||
randomize=false
|
randomize=false
|
||||||
valgrind=false
|
valgrind=false
|
||||||
|
cachemode=false
|
||||||
rm -f $tmp.list $tmp.tmp $tmp.sed
|
rm -f $tmp.list $tmp.tmp $tmp.sed
|
||||||
|
|
||||||
export IMGFMT=raw
|
export IMGFMT=raw
|
||||||
export IMGFMT_GENERIC=true
|
export IMGFMT_GENERIC=true
|
||||||
export IMGPROTO=file
|
export IMGPROTO=file
|
||||||
export IMGOPTS=""
|
export IMGOPTS=""
|
||||||
|
export CACHEMODE="writethrough"
|
||||||
export QEMU_IO_OPTIONS=""
|
export QEMU_IO_OPTIONS=""
|
||||||
|
export CACHEMODE_IS_DEFAULT=true
|
||||||
|
|
||||||
for r
|
for r
|
||||||
do
|
do
|
||||||
|
@ -113,7 +116,12 @@ s/ .*//p
|
||||||
IMGOPTS="$r"
|
IMGOPTS="$r"
|
||||||
imgopts=false
|
imgopts=false
|
||||||
continue
|
continue
|
||||||
|
elif $cachemode
|
||||||
|
then
|
||||||
|
CACHEMODE="$r"
|
||||||
|
CACHEMODE_IS_DEFAULT=false
|
||||||
|
cachemode=false
|
||||||
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
xpand=true
|
xpand=true
|
||||||
|
@ -147,6 +155,7 @@ check options
|
||||||
-o options -o options to pass to qemu-img create/convert
|
-o options -o options to pass to qemu-img create/convert
|
||||||
-T output timestamps
|
-T output timestamps
|
||||||
-r randomize test order
|
-r randomize test order
|
||||||
|
-c mode cache mode
|
||||||
|
|
||||||
testlist options
|
testlist options
|
||||||
-g group[,group...] include tests from these groups
|
-g group[,group...] include tests from these groups
|
||||||
|
@ -219,7 +228,8 @@ testlist options
|
||||||
xpand=false
|
xpand=false
|
||||||
;;
|
;;
|
||||||
-nocache)
|
-nocache)
|
||||||
QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS --nocache"
|
CACHEMODE="none"
|
||||||
|
CACHEMODE_IS_DEFAULT=false
|
||||||
xpand=false
|
xpand=false
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
@ -258,6 +268,10 @@ testlist options
|
||||||
imgopts=true
|
imgopts=true
|
||||||
xpand=false
|
xpand=false
|
||||||
;;
|
;;
|
||||||
|
-c)
|
||||||
|
cachemode=true
|
||||||
|
xpand=false
|
||||||
|
;;
|
||||||
-r) # randomize test order
|
-r) # randomize test order
|
||||||
randomize=true
|
randomize=true
|
||||||
xpand=false
|
xpand=false
|
||||||
|
@ -334,6 +348,9 @@ BEGIN { for (t='$start'; t<='$end'; t++) printf "%03d\n",t }' \
|
||||||
|
|
||||||
done
|
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 options for qemu-img create -o if they were not specified
|
||||||
_set_default_imgopts
|
_set_default_imgopts
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue