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 <f...@redhat.com> > --- > 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