From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45362) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TO8Wi-0001rb-MR for qemu-devel@nongnu.org; Tue, 16 Oct 2012 10:53:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TO8Wb-0004ZZ-3R for qemu-devel@nongnu.org; Tue, 16 Oct 2012 10:53:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:64839) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TO8Wa-0004ZH-Qa for qemu-devel@nongnu.org; Tue, 16 Oct 2012 10:53:41 -0400 Date: Tue, 16 Oct 2012 16:53:35 +0200 From: Stefan Hajnoczi Message-ID: <20121016145335.GC19559@stefanha-thinkpad> References: <1350305057-6287-1-git-send-email-stefanha@redhat.com> <1350305057-6287-4-git-send-email-stefanha@redhat.com> <507D356E.6090105@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <507D356E.6090105@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 3/3] qemu-iotests: Add 041 backing file chain infinite loop test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: kashyap.cv@gmail.com, qemu-devel@nongnu.org, =?iso-8859-1?Q?Beno=EEt?= Canet On Tue, Oct 16, 2012 at 12:22:38PM +0200, Kevin Wolf wrote: > 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 > > --- > > 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 . > > +# > > + > > +# 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. Thanks for pointing this out. > > 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)? This is a special case - we'll also need to carefully terminate the JSON array. So a fflush(stdout) with a comment works well. I will add it. > Also I think adding a test for JSON mode would make sense. I'll do that. Stefan