From: Jeff Cody Date: Thu, 10 Apr 2014 20:47:39 +0000 (-0400) Subject: block: qemu-iotests - fix image cleanup when using spaced pathnames X-Git-Tag: qemu-xen-4.6.0-rc1~480^2~24 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=c55752745536712f778e9a0d73a078bdb0360df2;p=qemu-upstream-4.6-testing.git block: qemu-iotests - fix image cleanup when using spaced pathnames The _rm_test_img() function in common.rc did not quote the image file, which left droppings in the scratch directory (and performed a potentially unsafe rm -f). This adds the necessary quotes. Reviewed-by: Benoit Canet Signed-off-by: Jeff Cody Signed-off-by: Kevin Wolf --- diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 7f00883ca..195c5646a 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -178,10 +178,10 @@ _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: \ + "$QEMU_IMG" info "$img" 2>/dev/null | grep 'filename:' | cut -f 2 -d: \ | xargs -I {} rm -f "{}" fi - rm -f $img + rm -f "$img" } _cleanup_test_img()