Skip to content
Snippets Groups Projects
Commit f210a83c authored by Fam Zheng's avatar Fam Zheng Committed by Stefan Hajnoczi
Browse files

qemu-iotests: Add _default_cache_mode and _supported_cache_modes


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: default avatarFam Zheng <famz@redhat.com>
Reviewed-by: default avatarWenchao Xia <xiawenc@linux.vnet.ibm.com>
Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
parent 58cc2ae1
No related branches found
No related tags found
No related merge requests found
...@@ -44,7 +44,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 ...@@ -44,7 +44,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
_supported_fmt qcow2 _supported_fmt qcow2
_supported_proto generic _supported_proto generic
_supported_os Linux _supported_os Linux
_default_cache_mode "writethrough"
_supported_cache_modes "writethrough" "none"
echo "Errors while writing 128 kB" echo "Errors while writing 128 kB"
echo echo
......
...@@ -44,7 +44,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 ...@@ -44,7 +44,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
_supported_fmt qcow2 _supported_fmt qcow2
_supported_proto generic _supported_proto generic
_supported_os Linux _supported_os Linux
_unsupported_qemu_io_options --nocache _default_cache_mode "writethrough"
_supported_cache_modes "writethrough"
size=128M size=128M
......
...@@ -41,8 +41,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 ...@@ -41,8 +41,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
_supported_fmt generic _supported_fmt generic
_supported_proto generic _supported_proto generic
_supported_os Linux _supported_os Linux
_unsupported_qemu_io_options --nocache _default_cache_mode "writethrough"
_supported_cache_modes "writethrough"
size=128M size=128M
_make_test_img $size _make_test_img $size
......
...@@ -387,18 +387,23 @@ _supported_os() ...@@ -387,18 +387,23 @@ _supported_os()
_notrun "not suitable for this OS: $HOSTOS" _notrun "not suitable for this OS: $HOSTOS"
} }
_unsupported_qemu_io_options() _supported_cache_modes()
{ {
for bad_opt for mode; do
do if [ "$mode" = "$CACHEMODE" ]; then
for opt in $QEMU_IO_OPTIONS return
do fi
if [ "$bad_opt" = "$opt" ]
then
_notrun "not suitable for qemu-io option: $bad_opt"
fi
done
done 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 # this test requires that a specified command (executable) exists
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment