From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45000) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VyemI-0006nQ-3v for qemu-devel@nongnu.org; Thu, 02 Jan 2014 04:41:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vyem9-00056c-M2 for qemu-devel@nongnu.org; Thu, 02 Jan 2014 04:41:22 -0500 Received: from mail-ea0-x233.google.com ([2a00:1450:4013:c01::233]:62361) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vyem9-00056V-FZ for qemu-devel@nongnu.org; Thu, 02 Jan 2014 04:41:13 -0500 Received: by mail-ea0-f179.google.com with SMTP id r15so6238143ead.10 for ; Thu, 02 Jan 2014 01:41:12 -0800 (PST) Date: Thu, 2 Jan 2014 17:40:58 +0800 From: Stefan Hajnoczi Message-ID: <20140102094058.GB4922@stefanha-thinkpad.redhat.com> References: <1385448034-28702-1-git-send-email-famz@redhat.com> <1385448034-28702-4-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1385448034-28702-4-git-send-email-famz@redhat.com> Subject: Re: [Qemu-devel] [PATCH 3/3] qemu-iotests: Clean up all extents for vmdk List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com On Tue, Nov 26, 2013 at 02:40:34PM +0800, Fam Zheng wrote: > This modifies _cleanup_test_img to remove all the extent files listed by > "qemu-img info"'s format specific information. > > Signed-off-by: Fam Zheng > --- > tests/qemu-iotests/common.rc | 17 ++++++++++++++--- > 1 file changed, 14 insertions(+), 3 deletions(-) > > diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc > index d465c48..fd635a0 100644 > --- a/tests/qemu-iotests/common.rc > +++ b/tests/qemu-iotests/common.rc > @@ -170,6 +170,17 @@ _make_test_img() > fi > } > > +_rm_test_img() > +{ > + local img=$1 > + if [ "$IMGFMT" = "vmdk" ]; then > + # Remove all the extents for vmdk > + $QEMU_IMG info $img 2>/dev/null | grep 'filename:' | cut -f 2 -d: \ > + | xargs -I {} rm -f "{}" > + fi > + rm -f $img > +} It would be nice to simply rm -rf "$TEST_DIR" instead of picking individual files. Not sure if anything prevents us from doing that. Anyway, this patch is okay for now. Stefan