[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 27/48] qemu-iotests: Add _default_cache_mode and _sup
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL 27/48] qemu-iotests: Add _default_cache_mode and _supported_cache_modes |
Date: |
Fri, 6 Dec 2013 17:36:26 +0100 |
From: Fam Zheng <address@hidden>
This replaces _unsupported_qemu_io_options and check for support of
current cache mode, and allow to provide a default if user didn't
specify.
Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Wenchao Xia <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
tests/qemu-iotests/026 | 3 ++-
tests/qemu-iotests/039 | 3 ++-
tests/qemu-iotests/052 | 4 ++--
tests/qemu-iotests/common.rc | 25 +++++++++++++++----------
4 files changed, 21 insertions(+), 14 deletions(-)
diff --git a/tests/qemu-iotests/026 b/tests/qemu-iotests/026
index ebe29d0..c9c5f83 100755
--- a/tests/qemu-iotests/026
+++ b/tests/qemu-iotests/026
@@ -44,7 +44,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
_supported_fmt qcow2
_supported_proto generic
_supported_os Linux
-
+_default_cache_mode "writethrough"
+_supported_cache_modes "writethrough" "none"
echo "Errors while writing 128 kB"
echo
diff --git a/tests/qemu-iotests/039 b/tests/qemu-iotests/039
index 8bade92..6abf472 100755
--- a/tests/qemu-iotests/039
+++ b/tests/qemu-iotests/039
@@ -44,7 +44,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
_supported_fmt qcow2
_supported_proto generic
_supported_os Linux
-_unsupported_qemu_io_options --nocache
+_default_cache_mode "writethrough"
+_supported_cache_modes "writethrough"
size=128M
diff --git a/tests/qemu-iotests/052 b/tests/qemu-iotests/052
index f5f9683..4d4e411 100755
--- a/tests/qemu-iotests/052
+++ b/tests/qemu-iotests/052
@@ -41,8 +41,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
_supported_fmt generic
_supported_proto generic
_supported_os Linux
-_unsupported_qemu_io_options --nocache
-
+_default_cache_mode "writethrough"
+_supported_cache_modes "writethrough"
size=128M
_make_test_img $size
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 7f62457..47cef6d 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -387,18 +387,23 @@ _supported_os()
_notrun "not suitable for this OS: $HOSTOS"
}
-_unsupported_qemu_io_options()
+_supported_cache_modes()
{
- for bad_opt
- do
- for opt in $QEMU_IO_OPTIONS
- do
- if [ "$bad_opt" = "$opt" ]
- then
- _notrun "not suitable for qemu-io option: $bad_opt"
- fi
- done
+ for mode; do
+ if [ "$mode" = "$CACHEMODE" ]; then
+ return
+ fi
done
+ _notrun "not suitable for cache mode: $CACHEMODE"
+}
+
+_default_cache_mode()
+{
+ if $CACHEMODE_IS_DEFAULT; then
+ CACHEMODE="$1"
+ QEMU_IO="$QEMU_IO --cache $1"
+ return
+ fi
}
# this test requires that a specified command (executable) exists
--
1.8.4.2
- [Qemu-devel] [PULL 17/48] raw-posix: implement write_zeroes with MAY_UNMAP for block devices, (continued)
- [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, 2013/12/06
- [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 <=
- [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
- [Qemu-devel] [PULL 37/48] qemu-img: add support for skipping zeroes in input during convert, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 38/48] qemu-img: fix usage instruction for qemu-img convert, Stefan Hajnoczi, 2013/12/06