qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH V12 6/6] add-cow: add qemu-iotests support
Date: Tue, 11 Sep 2012 11:55:05 +0200	[thread overview]
Message-ID: <504F0A79.1030106@redhat.com> (raw)
In-Reply-To: <1344613185-12308-7-git-send-email-wdongxu@linux.vnet.ibm.com>

Am 10.08.2012 17:39, schrieb Dong Xu Wang:
> Add qemu-iotests support for add-cow.
> 
> Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com>
> ---
>  tests/qemu-iotests/017       |    2 +-
>  tests/qemu-iotests/020       |    2 +-
>  tests/qemu-iotests/check     |    4 ++--
>  tests/qemu-iotests/common    |    6 ++++++
>  tests/qemu-iotests/common.rc |   19 +++++++++++++++++++
>  5 files changed, 29 insertions(+), 4 deletions(-)

> diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
> index 432732c..122267b 100755
> --- a/tests/qemu-iotests/check
> +++ b/tests/qemu-iotests/check
> @@ -243,7 +243,7 @@ do
>  		echo " - no qualified output"
>  		err=true
>  	    else
> -		if diff -w $seq.out $tmp.out >/dev/null 2>&1
> +        if diff -w -I "^Formatting" $seq.out $tmp.out >/dev/null 2>&1
>  		then
>  		    echo ""
>  		    if $err
> @@ -255,7 +255,7 @@ do
>  		else
>  		    echo " - output mismatch (see $seq.out.bad)"
>  		    mv $tmp.out $seq.out.bad
> -		    $diff -w $seq.out $seq.out.bad
> +            $diff -w -I "^Formatting" $seq.out $seq.out.bad
>  		    err=true
>  		fi
>  	    fi

These two hunks don't look right. You probably want to amend the sed
command in _make_test_img().

> diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
> index 7782808..ec5afd7 100644
> --- a/tests/qemu-iotests/common.rc
> +++ b/tests/qemu-iotests/common.rc
> @@ -97,6 +97,18 @@ _make_test_img()
>      fi
>      if [ \( "$IMGFMT" = "qcow2" -o "$IMGFMT" = "qed" \) -a -n "$CLUSTER_SIZE" ]; then
>          optstr=$(_optstr_add "$optstr" "cluster_size=$CLUSTER_SIZE")
> +    elif [ "$IMGFMT" = "add-cow" ]; then
> +        local BACKING="$TEST_IMG"".qcow2"
> +        local IMG="$TEST_IMG"".raw"
> +        if [ "$1" = "-b" ]; then
> +            IMG="$IMG"".b"
> +            $QEMU_IMG create -f raw $IMG $image_size>/dev/null
> +            extra_img_options="-o image_file=$IMG $extra_img_options"
> +        else
> +            $QEMU_IMG create -f raw $IMG $image_size>/dev/null
> +            $QEMU_IMG create -f qcow2 $BACKING $image_size>/dev/null
> +            extra_img_options="-o backing_file=$BACKING,image_file=$IMG"
> +        fi

This looks a bit hackish... Doesn't it completely ignore the requested
backing file name? I'm not sure if this is a good idea.

Can't you just create the raw image file and then use _optstr_add to add
the right -o image_file=... option? It should automatically get the
backing file right.

>      fi
>  
>      if [ -n "$optstr" ]; then
> @@ -125,6 +137,13 @@ _cleanup_test_img()
>              rm -f $TEST_DIR/t.$IMGFMT
>              rm -f $TEST_DIR/t.$IMGFMT.orig
>              rm -f $TEST_DIR/t.$IMGFMT.base
> +            if [ "$IMGFMT" = "add-cow" ]; then
> +                rm -f $TEST_DIR/t.$IMGFMT.qcow2
> +                rm -f $TEST_DIR/t.$IMGFMT.raw
> +                rm -f $TEST_DIR/t.$IMGFMT.raw.b
> +                rm -f $TEST_DIR/t.$IMGFMT.ct.qcow2
> +                rm -f $TEST_DIR/t.$IMGFMT.ct.raw

What are the .ct files?

Kevin

  reply	other threads:[~2012-09-11  9:55 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-10 15:39 [Qemu-devel] [PATCH V12 0/6] add-cow file format Dong Xu Wang
2012-08-10 15:39 ` [Qemu-devel] [PATCH V12 1/6] docs: document for " Dong Xu Wang
2012-09-06 17:27   ` Michael Roth
2012-09-10  1:48     ` Dong Xu Wang
2012-09-10 15:23   ` Kevin Wolf
2012-09-11  2:12     ` Dong Xu Wang
2012-08-10 15:39 ` [Qemu-devel] [PATCH V12 2/6] make path_has_protocol non-static Dong Xu Wang
2012-09-06 17:27   ` Michael Roth
2012-08-10 15:39 ` [Qemu-devel] [PATCH V12 3/6] qed_read_string to bdrv_read_string Dong Xu Wang
2012-09-06 17:32   ` Michael Roth
2012-09-10  1:49     ` Dong Xu Wang
2012-08-10 15:39 ` [Qemu-devel] [PATCH V12 4/6] rename qcow2-cache.c to block-cache.c Dong Xu Wang
2012-09-06 17:52   ` Michael Roth
2012-09-10  2:14     ` Dong Xu Wang
2012-09-11  8:41   ` Kevin Wolf
2012-08-10 15:39 ` [Qemu-devel] [PATCH V12 5/6] add-cow file format Dong Xu Wang
2012-09-06 20:19   ` Michael Roth
2012-09-10  2:25     ` Dong Xu Wang
2012-09-11  9:44       ` Kevin Wolf
2012-09-11  9:40   ` Kevin Wolf
2012-09-12  7:28     ` Dong Xu Wang
2012-09-12  7:50       ` Kevin Wolf
2012-08-10 15:39 ` [Qemu-devel] [PATCH V12 6/6] add-cow: add qemu-iotests support Dong Xu Wang
2012-09-11  9:55   ` Kevin Wolf [this message]
2012-08-23  5:34 ` [Qemu-devel] [PATCH V12 0/6] add-cow file format Dong Xu Wang

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=504F0A79.1030106@redhat.com \
    --to=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wdongxu@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).