qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, WenchaoXia <xiawenc@linux.vnet.ibm.com>,
	stefanha@redhat.com
Subject: [Qemu-devel] [PATCH v3 3/6] qemu-iotests: Add _supported_cache_modes
Date: Wed, 20 Nov 2013 15:44:14 +0800	[thread overview]
Message-ID: <1384933457-26953-4-git-send-email-famz@redhat.com> (raw)
In-Reply-To: <1384933457-26953-1-git-send-email-famz@redhat.com>

This replaces _unsupported_qemu_io_options and check for support of
current cache mode.

If user dosen't give "-c <mode>" or "-nocache", the first supported
cache mode is used in qemu-io.

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 tests/qemu-iotests/026       |  2 +-
 tests/qemu-iotests/039       |  2 +-
 tests/qemu-iotests/052       |  3 +--
 tests/qemu-iotests/common.rc | 20 ++++++++++----------
 4 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/tests/qemu-iotests/026 b/tests/qemu-iotests/026
index ebe29d0..9078cd8 100755
--- a/tests/qemu-iotests/026
+++ b/tests/qemu-iotests/026
@@ -44,7 +44,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fmt qcow2
 _supported_proto generic
 _supported_os Linux
-
+_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..a298b50 100755
--- a/tests/qemu-iotests/039
+++ b/tests/qemu-iotests/039
@@ -44,7 +44,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fmt qcow2
 _supported_proto generic
 _supported_os Linux
-_unsupported_qemu_io_options --nocache
+_supported_cache_modes "writethrough"
 
 size=128M
 
diff --git a/tests/qemu-iotests/052 b/tests/qemu-iotests/052
index f5f9683..6d96c99 100755
--- a/tests/qemu-iotests/052
+++ b/tests/qemu-iotests/052
@@ -41,8 +41,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fmt generic
 _supported_proto generic
 _supported_os Linux
-_unsupported_qemu_io_options --nocache
-
+_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..15d5bbd 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -387,18 +387,18 @@ _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
+    if $CACHEMODE_IS_DEFAULT; then
+        QEMU_IO="$QEMU_IO -t $1"
+        return
+    fi
+    for mode; do
+        if [ "$mode" = "$CACHEMODE" ]; then
+            return
+        fi
     done
+    _notrun "not suitable for cache mode: $CACHEMODE"
 }
 
 # this test requires that a specified command (executable) exists
-- 
1.8.4.2

  parent reply	other threads:[~2013-11-20  7:44 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-20  7:44 [Qemu-devel] [PATCH v3 0/6] Add cache mode option to qemu-iotests, and change default mode to "writeback" Fam Zheng
2013-11-20  7:44 ` [Qemu-devel] [PATCH v3 1/6] qemu-iotests: Add "-c <cache-mode>" option Fam Zheng
2013-11-20  7:44 ` [Qemu-devel] [PATCH v3 2/6] qemu-iotests: Honour cache mode in iotests.py Fam Zheng
2013-11-20  7:44 ` Fam Zheng [this message]
2013-11-21 12:39   ` [Qemu-devel] [PATCH v3 3/6] qemu-iotests: Add _supported_cache_modes Stefan Hajnoczi
2013-11-21 12:46     ` Fam Zheng
2013-11-20  7:44 ` [Qemu-devel] [PATCH v3 4/6] qemu-iotests: Change default cache mode to "writeback" Fam Zheng
2013-11-20  7:44 ` [Qemu-devel] [PATCH v3 5/6] qemu-iotests: Force qcow2 in error path test in 048 Fam Zheng
2013-11-21 12:41   ` Stefan Hajnoczi
2013-11-21 12:50     ` Fam Zheng
2013-11-20  7:44 ` [Qemu-devel] [PATCH v3 6/6] qemu-iotests: Clean up spaces in usage output Fam Zheng
2013-11-21 12:43 ` [Qemu-devel] [PATCH v3 0/6] Add cache mode option to qemu-iotests, and change default mode to "writeback" Stefan Hajnoczi
2013-11-21 14:16   ` Kevin Wolf
2013-11-22  8:57     ` Stefan Hajnoczi
2013-11-22  9:30       ` Kevin Wolf
2013-11-22 15:51         ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1384933457-26953-4-git-send-email-famz@redhat.com \
    --to=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=xiawenc@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).