Re: [Qemu-devel] [PATCH v6 14/14] qemu-iotest: enable testing with qemu-io aio options

2019-07-24 Thread Julia Suvorova

On 7/19/19 3:35 PM, Aarushi Mehta wrote:
 @@ -225,6 +227,10 @@ s/ .*//p

  CACHEMODE_IS_DEFAULT=false
  cachemode=false
  continue
+elif $aiomode
+then
+AIOMODE="$r"
+aiomode=false


'continue' is missed here.

Best regards, Julia Suvorova.



Re: [Qemu-devel] [PATCH v6 14/14] qemu-iotest: enable testing with qemu-io aio options

2019-07-19 Thread Stefan Hajnoczi
On Fri, Jul 19, 2019 at 07:05:30PM +0530, Aarushi Mehta wrote:
> Signed-off-by: Aarushi Mehta 
> ---
>  tests/qemu-iotests/check | 14 +-
>  tests/qemu-iotests/common.rc | 10 ++
>  2 files changed, 23 insertions(+), 1 deletion(-)

So far this patch affects qemu-io only.  That's a good start but more
can be done.

Taking CACHEMODE as an example, there are other places where the
parameter can be added.  The main one is qemu -drive options but
qemu-img could also use AIOMODE.

Please add an aiomode variable to the iotests.py module (see how
cachemode is set there) so that Python tests can use the the value set
on the ./check command-line.


signature.asc
Description: PGP signature


[Qemu-devel] [PATCH v6 14/14] qemu-iotest: enable testing with qemu-io aio options

2019-07-19 Thread Aarushi Mehta
Signed-off-by: Aarushi Mehta 
---
 tests/qemu-iotests/check | 14 +-
 tests/qemu-iotests/common.rc | 10 ++
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index f925606cc5..2bc5bc62e2 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -132,6 +132,7 @@ sortme=false
 expunge=true
 have_test_arg=false
 cachemode=false
+aiomode=false
 
 tmp="${TEST_DIR}"/$$
 rm -f $tmp.list $tmp.tmp $tmp.sed
@@ -141,6 +142,7 @@ export IMGFMT_GENERIC=true
 export IMGPROTO=file
 export IMGOPTS=""
 export CACHEMODE="writeback"
+export AIOMODE="threads"
 export QEMU_IO_OPTIONS=""
 export QEMU_IO_OPTIONS_NO_FMT=""
 export CACHEMODE_IS_DEFAULT=true
@@ -225,6 +227,10 @@ s/ .*//p
 CACHEMODE_IS_DEFAULT=false
 cachemode=false
 continue
+elif $aiomode
+then
+AIOMODE="$r"
+aiomode=false
 fi
 
 xpand=true
@@ -269,6 +275,7 @@ other options
 -n  show me, do not run tests
 -o options  -o options to pass to qemu-img create/convert
 -c mode cache mode
+-i mode AIO mode
 -makecheck  pretty print output for make check
 
 testlist options
@@ -433,10 +440,13 @@ testlist options
 cachemode=true
 xpand=false
 ;;
+-i)
+aiomode=true
+xpand=false
+;;
 -T)# deprecated timestamp option
 xpand=false
 ;;
-
 -v)
 verbose=true
 xpand=false
@@ -515,6 +525,8 @@ done
 
 # Set qemu-io cache mode with $CACHEMODE we have
 QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS --cache $CACHEMODE"
+# Set qemu-io aio mode with $AIOMODE we have
+QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS --aio $AIOMODE"
 
 QEMU_IO_OPTIONS_NO_FMT="$QEMU_IO_OPTIONS"
 if [ "$IMGOPTSSYNTAX" != "true" ]; then
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 5502c3da2f..39c04cc169 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -482,6 +482,16 @@ _supported_cache_modes()
 _notrun "not suitable for cache mode: $CACHEMODE"
 }
 
+_supported_aio_modes()
+{
+for mode; do
+if [ "$mode" = "$AIOMODE" ]; then
+return
+fi
+done
+_notrun "not suitable for aio mode: $AIOMODE"
+}
+
 _default_cache_mode()
 {
 if $CACHEMODE_IS_DEFAULT; then
-- 
2.21.0