[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 25/48] qemu-iotests: Add "-c <cache-mode>" option
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL 25/48] qemu-iotests: Add "-c <cache-mode>" option |
Date: |
Fri, 6 Dec 2013 17:36:24 +0100 |
From: Fam Zheng <address@hidden>
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 <address@hidden>
Reviewed-by: Wenchao Xia <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
tests/qemu-iotests/check | 2 +-
tests/qemu-iotests/common | 21 +++++++++++++++++++--
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index f5f328f..dc0105c 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -242,7 +242,7 @@ do
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
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
--
1.8.4.2
- [Qemu-devel] [PULL 14/48] block/iscsi: updated copyright, (continued)
- [Qemu-devel] [PULL 14/48] block/iscsi: updated copyright, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 16/48] raw-posix: implement write_zeroes with MAY_UNMAP for files, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 17/48] raw-posix: implement write_zeroes with MAY_UNMAP for block devices, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 18/48] raw-posix: add support for write_zeroes on XFS and block devices, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 19/48] qemu-iotests: 033 is fast, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 20/48] scsi-disk: catch write protection errors in UNMAP, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 21/48] scsi-disk: reject ANCHOR=1 for UNMAP and WRITE SAME commands, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 22/48] scsi-disk: correctly implement WRITE SAME, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 23/48] block: Close backing file early in bdrv_img_create, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 24/48] qcow2: Zero-initialise first cluster for new images, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 25/48] qemu-iotests: Add "-c <cache-mode>" option,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL 26/48] qemu-iotests: Honour cache mode in iotests.py, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 27/48] qemu-iotests: Add _default_cache_mode and _supported_cache_modes, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 28/48] qemu-iotests: Change default cache mode to "writeback", Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 29/48] qemu-iotests: Clean up spaces in usage output, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 30/48] qemu-iotests: Split qcow2 only cases in 048, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 32/48] qemu-nbd: support internal snapshot export, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 33/48] qemu-iotests: add 058 internal snapshot export with qemu-nbd case, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 34/48] qemu-img: add -l for snapshot in convert, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 35/48] qemu-iotests: add test for snapshot in qemu-img convert, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 36/48] qemu-nbd: add doc for option -f, Stefan Hajnoczi, 2013/12/06