Re: [Qemu-devel] [PATCH v7 1/3] block: add support for --image-opts in block I/O tests

2016-03-30 Thread Daniel P. Berrange
On Wed, Mar 30, 2016 at 05:44:41PM +0200, Max Reitz wrote:
> On 30.03.2016 15:53, Daniel P. Berrange wrote:
> > Currently all block tests use the traditional syntax for images
> > just specifying a filename. To support the LUKS driver without
> > resorting to JSON, the tests need to be able to use the new
> > --image-opts argument to qemu-img and qemu-io.
> > 
> > This introduces a new env variable IMGOPTSSYNTAX. If this is
> > set to 'true', then qemu-img/qemu-io should use --image-opts.
> > 
> > Signed-off-by: Daniel P. Berrange 
> > ---
> >  tests/qemu-iotests/039.out   | 20 +++---
> >  tests/qemu-iotests/common|  7 -
> >  tests/qemu-iotests/common.config | 15 +--
> >  tests/qemu-iotests/common.rc | 57 
> > +---
> >  4 files changed, 71 insertions(+), 28 deletions(-)
> > 
> > diff --git a/tests/qemu-iotests/039.out b/tests/qemu-iotests/039.out
> > index 32c8846..c6e0ac2 100644
> > --- a/tests/qemu-iotests/039.out
> > +++ b/tests/qemu-iotests/039.out
> > @@ -12,9 +12,9 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
> >  wrote 512/512 bytes at offset 0
> >  512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> >  ./common.config: Killed  ( if [ "${VALGRIND_QEMU}" == "y" 
> > ]; then
> > -exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 
> > "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@";
> > +exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 
> > "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
> >  else
> > -exec "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@";
> > +exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
> >  fi )
> >  incompatible_features 0x1
> >  ERROR cluster 5 refcount=0 reference=1
> > @@ -51,9 +51,9 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
> >  wrote 512/512 bytes at offset 0
> >  512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> >  ./common.config: Killed  ( if [ "${VALGRIND_QEMU}" == "y" 
> > ]; then
> > -exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 
> > "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@";
> > +exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 
> > "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
> >  else
> > -exec "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@";
> > +exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
> >  fi )
> >  incompatible_features 0x1
> >  ERROR cluster 5 refcount=0 reference=1
> > @@ -69,9 +69,9 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
> >  wrote 512/512 bytes at offset 0
> >  512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> >  ./common.config: Killed  ( if [ "${VALGRIND_QEMU}" == "y" 
> > ]; then
> > -exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 
> > "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@";
> > +exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 
> > "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
> >  else
> > -exec "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@";
> > +exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
> >  fi )
> >  incompatible_features 0x0
> >  No errors were found on the image.
> > @@ -92,9 +92,9 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
> >  wrote 512/512 bytes at offset 0
> >  512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> >  ./common.config: Killed  ( if [ "${VALGRIND_QEMU}" == "y" 
> > ]; then
> > -exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 
> > "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@";
> > +exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 
> > "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
> >  else
> > -exec "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@";
> > +exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
> >  fi )
> >  incompatible_features 0x1
> >  ERROR cluster 5 refcount=0 reference=1
> > @@ -106,9 +106,9 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT 
> > size=134217728
> >  wrote 512/512 bytes at offset 0
> >  512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> >  ./common.config: Killed  ( if [ "${VALGRIND_QEMU}" == "y" 
> > ]; then
> > -exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 
> > "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@";
> > +exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 
> > "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
> >  else
> > -exec "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@";
> > +exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
> >  fi )
> >  incompatible_features 0x0
> >  No errors were found on the image.
> 
> I think 061 and 137 need the same treatment.
> 
> Looks good apart from that.

FWIW, I didn't attempt to update those because they're qcow2 only. I
only tried to update tests which were (potentially) runnable with
the luks block driver.

Regards,
Daniel
-- 
|: http://berrange.com  -o-http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org  -o- 

Re: [Qemu-devel] [PATCH v7 1/3] block: add support for --image-opts in block I/O tests

2016-03-30 Thread Max Reitz
On 30.03.2016 15:53, Daniel P. Berrange wrote:
> Currently all block tests use the traditional syntax for images
> just specifying a filename. To support the LUKS driver without
> resorting to JSON, the tests need to be able to use the new
> --image-opts argument to qemu-img and qemu-io.
> 
> This introduces a new env variable IMGOPTSSYNTAX. If this is
> set to 'true', then qemu-img/qemu-io should use --image-opts.
> 
> Signed-off-by: Daniel P. Berrange 
> ---
>  tests/qemu-iotests/039.out   | 20 +++---
>  tests/qemu-iotests/common|  7 -
>  tests/qemu-iotests/common.config | 15 +--
>  tests/qemu-iotests/common.rc | 57 
> +---
>  4 files changed, 71 insertions(+), 28 deletions(-)
> 
> diff --git a/tests/qemu-iotests/039.out b/tests/qemu-iotests/039.out
> index 32c8846..c6e0ac2 100644
> --- a/tests/qemu-iotests/039.out
> +++ b/tests/qemu-iotests/039.out
> @@ -12,9 +12,9 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
>  wrote 512/512 bytes at offset 0
>  512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
>  ./common.config: Killed  ( if [ "${VALGRIND_QEMU}" == "y" ]; 
> then
> -exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 
> "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@";
> +exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 
> "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
>  else
> -exec "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@";
> +exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
>  fi )
>  incompatible_features 0x1
>  ERROR cluster 5 refcount=0 reference=1
> @@ -51,9 +51,9 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
>  wrote 512/512 bytes at offset 0
>  512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
>  ./common.config: Killed  ( if [ "${VALGRIND_QEMU}" == "y" ]; 
> then
> -exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 
> "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@";
> +exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 
> "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
>  else
> -exec "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@";
> +exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
>  fi )
>  incompatible_features 0x1
>  ERROR cluster 5 refcount=0 reference=1
> @@ -69,9 +69,9 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
>  wrote 512/512 bytes at offset 0
>  512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
>  ./common.config: Killed  ( if [ "${VALGRIND_QEMU}" == "y" ]; 
> then
> -exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 
> "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@";
> +exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 
> "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
>  else
> -exec "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@";
> +exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
>  fi )
>  incompatible_features 0x0
>  No errors were found on the image.
> @@ -92,9 +92,9 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
>  wrote 512/512 bytes at offset 0
>  512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
>  ./common.config: Killed  ( if [ "${VALGRIND_QEMU}" == "y" ]; 
> then
> -exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 
> "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@";
> +exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 
> "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
>  else
> -exec "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@";
> +exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
>  fi )
>  incompatible_features 0x1
>  ERROR cluster 5 refcount=0 reference=1
> @@ -106,9 +106,9 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
>  wrote 512/512 bytes at offset 0
>  512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
>  ./common.config: Killed  ( if [ "${VALGRIND_QEMU}" == "y" ]; 
> then
> -exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 
> "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@";
> +exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 
> "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
>  else
> -exec "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@";
> +exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
>  fi )
>  incompatible_features 0x0
>  No errors were found on the image.

I think 061 and 137 need the same treatment.

Looks good apart from that.

Max



signature.asc
Description: OpenPGP digital signature


[Qemu-devel] [PATCH v7 1/3] block: add support for --image-opts in block I/O tests

2016-03-30 Thread Daniel P. Berrange
Currently all block tests use the traditional syntax for images
just specifying a filename. To support the LUKS driver without
resorting to JSON, the tests need to be able to use the new
--image-opts argument to qemu-img and qemu-io.

This introduces a new env variable IMGOPTSSYNTAX. If this is
set to 'true', then qemu-img/qemu-io should use --image-opts.

Signed-off-by: Daniel P. Berrange 
---
 tests/qemu-iotests/039.out   | 20 +++---
 tests/qemu-iotests/common|  7 -
 tests/qemu-iotests/common.config | 15 +--
 tests/qemu-iotests/common.rc | 57 +---
 4 files changed, 71 insertions(+), 28 deletions(-)

diff --git a/tests/qemu-iotests/039.out b/tests/qemu-iotests/039.out
index 32c8846..c6e0ac2 100644
--- a/tests/qemu-iotests/039.out
+++ b/tests/qemu-iotests/039.out
@@ -12,9 +12,9 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
 wrote 512/512 bytes at offset 0
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 ./common.config: Killed  ( if [ "${VALGRIND_QEMU}" == "y" ]; 
then
-exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 
"$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@";
+exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 
"$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
 else
-exec "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@";
+exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
 fi )
 incompatible_features 0x1
 ERROR cluster 5 refcount=0 reference=1
@@ -51,9 +51,9 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
 wrote 512/512 bytes at offset 0
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 ./common.config: Killed  ( if [ "${VALGRIND_QEMU}" == "y" ]; 
then
-exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 
"$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@";
+exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 
"$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
 else
-exec "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@";
+exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
 fi )
 incompatible_features 0x1
 ERROR cluster 5 refcount=0 reference=1
@@ -69,9 +69,9 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
 wrote 512/512 bytes at offset 0
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 ./common.config: Killed  ( if [ "${VALGRIND_QEMU}" == "y" ]; 
then
-exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 
"$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@";
+exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 
"$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
 else
-exec "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@";
+exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
 fi )
 incompatible_features 0x0
 No errors were found on the image.
@@ -92,9 +92,9 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
 wrote 512/512 bytes at offset 0
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 ./common.config: Killed  ( if [ "${VALGRIND_QEMU}" == "y" ]; 
then
-exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 
"$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@";
+exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 
"$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
 else
-exec "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@";
+exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
 fi )
 incompatible_features 0x1
 ERROR cluster 5 refcount=0 reference=1
@@ -106,9 +106,9 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
 wrote 512/512 bytes at offset 0
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
 ./common.config: Killed  ( if [ "${VALGRIND_QEMU}" == "y" ]; 
then
-exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 
"$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@";
+exec valgrind --log-file="${VALGRIND_LOGFILE}" --error-exitcode=99 
"$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
 else
-exec "$QEMU_IO_PROG" $QEMU_IO_OPTIONS "$@";
+exec "$QEMU_IO_PROG" $QEMU_IO_ARGS "$@";
 fi )
 incompatible_features 0x0
 No errors were found on the image.
diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common
index 49e1931..fe3b1a0 100644
--- a/tests/qemu-iotests/common
+++ b/tests/qemu-iotests/common
@@ -53,6 +53,7 @@ export QEMU_IO_OPTIONS=""
 export CACHEMODE_IS_DEFAULT=true
 export QEMU_OPTIONS="-nodefaults"
 export VALGRIND_QEMU=
+export IMGOPTSSYNTAX=false
 
 for r
 do
@@ -399,7 +400,11 @@ 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 -f $IMGFMT --cache $CACHEMODE"
+if [ "$IMGOPTSSYNTAX" = "true" ]; then
+QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS --cache $CACHEMODE"
+else
+QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS -f $IMGFMT --cache $CACHEMODE"
+fi
 
 # Set default options for qemu-img create -o if they were not specified
 _set_default_imgopts
diff --git a/tests/qemu-iotests/common.config