qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: kashyap.cv@gmail.com, qemu-devel@nongnu.org,
	"Benoît Canet" <benoit@irqsave.net>
Subject: Re: [Qemu-devel] [PATCH v2 3/3] qemu-iotests: Add 041 backing file chain infinite loop test
Date: Tue, 16 Oct 2012 12:22:38 +0200	[thread overview]
Message-ID: <507D356E.6090105@redhat.com> (raw)
In-Reply-To: <1350305057-6287-4-git-send-email-stefanha@redhat.com>

Am 15.10.2012 14:44, schrieb Stefan Hajnoczi:
> This new test verifies that qemu-img info --backing-chain safely aborts
> when an image file has a backing file infinite loop.
> 
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>  tests/qemu-iotests/041       | 90 ++++++++++++++++++++++++++++++++++++++++++++
>  tests/qemu-iotests/041.out   | 81 +++++++++++++++++++++++++++++++++++++++
>  tests/qemu-iotests/common.rc |  9 +++++
>  tests/qemu-iotests/group     |  1 +
>  4 files changed, 181 insertions(+)
>  create mode 100755 tests/qemu-iotests/041
>  create mode 100644 tests/qemu-iotests/041.out
> 
> diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041
> new file mode 100755
> index 0000000..839255f
> --- /dev/null
> +++ b/tests/qemu-iotests/041
> @@ -0,0 +1,90 @@
> +#!/bin/bash
> +#
> +# Test that qemu-img info --backing-chain detects infinite loops
> +#
> +# Copyright (C) 2012 Red Hat, Inc.
> +#
> +# This program is free software; you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation; either version 2 of the License, or
> +# (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +#
> +
> +# creator
> +owner=stefanha@redhat.com
> +
> +seq=`basename $0`
> +echo "QA output created by $seq"
> +
> +here=`pwd`
> +tmp=/tmp/$$
> +status=1	# failure is the default!
> +
> +_cleanup()
> +{
> +	_cleanup_test_img

This forgets to remove $TEST_IMG.[123].base.

> diff --git a/tests/qemu-iotests/041.out b/tests/qemu-iotests/041.out
> new file mode 100644
> index 0000000..0c871b0
> --- /dev/null
> +++ b/tests/qemu-iotests/041.out
> @@ -0,0 +1,81 @@
> +QA output created by 041
> +Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 
> +
> +== backing file references self ==
> +qemu-img: Aborting due to backing file chain infinite loop.
> +image: TEST_DIR/t.IMGFMT
> +file format: IMGFMT
> +virtual size: 128M (134217728 bytes)
> +cluster_size: 65536
> +backing file: TEST_DIR/t.IMGFMT

I'd expect the error message to be at the end. Should we disable stdout
buffering completely in qemu-img or add an fflush(stdout)?

Also I think adding a test for JSON mode would make sense.

Kevin

  parent reply	other threads:[~2012-10-16 10:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-15 12:44 [Qemu-devel] [PATCH v2 0/3] qemu-img: Add --backing-chain option to info command Stefan Hajnoczi
2012-10-15 12:44 ` [Qemu-devel] [PATCH v2 1/3] " Stefan Hajnoczi
2012-10-16 10:04   ` Kevin Wolf
2012-10-16 14:51     ` Stefan Hajnoczi
2012-10-15 12:44 ` [Qemu-devel] [PATCH v2 2/3] qemu-img: Detect backing file chain infinite loops Stefan Hajnoczi
2012-10-16 10:11   ` Kevin Wolf
2012-10-16 14:42     ` Stefan Hajnoczi
2012-10-16 14:58       ` Kevin Wolf
2012-10-15 12:44 ` [Qemu-devel] [PATCH v2 3/3] qemu-iotests: Add 041 backing file chain infinite loop test Stefan Hajnoczi
2012-10-15 17:47   ` Eric Blake
2012-10-16  8:21     ` Stefan Hajnoczi
2012-10-16 10:22   ` Kevin Wolf [this message]
2012-10-16 14:53     ` Stefan Hajnoczi
2012-10-15 17:49 ` [Qemu-devel] [PATCH v2 0/3] qemu-img: Add --backing-chain option to info command Eric Blake

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=507D356E.6090105@redhat.com \
    --to=kwolf@redhat.com \
    --cc=benoit@irqsave.net \
    --cc=kashyap.cv@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.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).