aboutsummaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/common
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2013-12-04 09:06:58 +0800
committerStefan Hajnoczi <stefanha@redhat.com>2013-12-04 11:55:13 +0100
commit3baa84491a43c6ba4909cbff69a9f045df9f4879 (patch)
tree37d9ff0fc281d4b702367f1f0a220aaea40f746f /tests/qemu-iotests/common
parentf8413b3c23b08a547ce18609acc6fae5fd04ed5c (diff)
downloadqemu-3baa84491a43c6ba4909cbff69a9f045df9f4879.zip
qemu-3baa84491a43c6ba4909cbff69a9f045df9f4879.tar.gz
qemu-3baa84491a43c6ba4909cbff69a9f045df9f4879.tar.bz2
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>
Diffstat (limited to 'tests/qemu-iotests/common')
-rw-r--r--tests/qemu-iotests/common21
1 files changed, 19 insertions, 2 deletions
diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common
index 8cde7f1..4743c9e 100644
--- a/tests/qemu-iotests/common
+++ b/tests/qemu-iotests/common
@@ -42,13 +42,16 @@ expunge=true
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
@@ -113,7 +116,12 @@ s/ .*//p
IMGOPTS="$r"
imgopts=false
continue
-
+ elif $cachemode
+ then
+ CACHEMODE="$r"
+ CACHEMODE_IS_DEFAULT=false
+ cachemode=false
+ continue
fi
xpand=true
@@ -147,6 +155,7 @@ check options
-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
@@ -219,7 +228,8 @@ testlist options
xpand=false
;;
-nocache)
- QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS --nocache"
+ CACHEMODE="none"
+ CACHEMODE_IS_DEFAULT=false
xpand=false
;;
@@ -258,6 +268,10 @@ testlist options
imgopts=true
xpand=false
;;
+ -c)
+ cachemode=true
+ xpand=false
+ ;;
-r) # randomize test order
randomize=true
xpand=false
@@ -334,6 +348,9 @@ BEGIN { for (t='$start'; t<='$end'; t++) printf "%03d\n",t }' \
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