From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51395) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3Ncr-0006th-8y for qemu-devel@nongnu.org; Wed, 15 Jan 2014 05:23:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W3Ncj-0000io-Ca for qemu-devel@nongnu.org; Wed, 15 Jan 2014 05:23:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:21779) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3Ncj-0000ij-4V for qemu-devel@nongnu.org; Wed, 15 Jan 2014 05:23:01 -0500 From: Kevin Wolf Date: Wed, 15 Jan 2014 11:22:17 +0100 Message-Id: <1389781375-11774-5-git-send-email-kwolf@redhat.com> In-Reply-To: <1389781375-11774-1-git-send-email-kwolf@redhat.com> References: <1389781375-11774-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL 04/42] qemu-iotests: Clean up all extents for vmdk List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org From: Fam Zheng 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 Signed-off-by: Stefan Hajnoczi Signed-off-by: Kevin Wolf --- 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 2489c43..0f68156 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 +} + _cleanup_test_img() { case "$IMGPROTO" in @@ -179,9 +190,9 @@ _cleanup_test_img() rm -f "$TEST_IMG_FILE" ;; file) - rm -f "$TEST_DIR/t.$IMGFMT" - rm -f "$TEST_DIR/t.$IMGFMT.orig" - rm -f "$TEST_DIR/t.$IMGFMT.base" + _rm_test_img "$TEST_DIR/t.$IMGFMT" + _rm_test_img "$TEST_DIR/t.$IMGFMT.orig" + _rm_test_img "$TEST_DIR/t.$IMGFMT.base" if [ -n "$SAMPLE_IMG_FILE" ] then rm -f "$TEST_DIR/$SAMPLE_IMG_FILE" -- 1.8.1.4