From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39782) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7tO8-0007NT-Pi for qemu-devel@nongnu.org; Wed, 14 Mar 2012 14:57:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S7tO3-0001Qj-Ti for qemu-devel@nongnu.org; Wed, 14 Mar 2012 14:57:32 -0400 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:47132) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7tO3-0001QN-N3 for qemu-devel@nongnu.org; Wed, 14 Mar 2012 14:57:27 -0400 From: Stefan Weil Date: Wed, 14 Mar 2012 19:57:23 +0100 Message-Id: <1331751444-30905-1-git-send-email-sw@weilnetz.de> Subject: [Qemu-devel] [PATCH 1/2] qemu-iotests: Fix call syntax for qemu-img List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Stefan Weil qemu-img requires first options, then file name, then size. GNU getopt also allows options at the end, but POSIX getopt doesn't. Try "export POSIXLY_CORRECT=y" to get the POSIX behaviour with GNU getopt, too. Cc: Kevin Wolf Signed-off-by: Stefan Weil --- tests/qemu-iotests/common.rc | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 26811ca..4cb8dae 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -57,16 +57,21 @@ _make_test_img() { # extra qemu-img options can be added by tests # at least one argument (the image size) needs to be added - local extra_img_options=$* + local extra_img_options="" local cluster_size_filter="s# cluster_size=[0-9]\\+##g" + local image_size=$* + if [ "$1" = "-b" ]; then + extra_img_options="$1 $2" + image_size=$3 + fi if [ \( "$IMGFMT" = "qcow2" -o "$IMGFMT" = "qed" \) -a -n "$CLUSTER_SIZE" ]; then extra_img_options="-o cluster_size=$CLUSTER_SIZE $extra_img_options" cluster_size_filter="" fi # XXX(hch): have global image options? - $QEMU_IMG create -f $IMGFMT $TEST_IMG $extra_img_options | \ + $QEMU_IMG create -f $IMGFMT $extra_img_options $TEST_IMG $image_size | \ sed -e "s#$IMGPROTO:$TEST_DIR#TEST_DIR#g" | \ sed -e "s#$TEST_DIR#TEST_DIR#g" | \ sed -e "s#$IMGFMT#IMGFMT#g" | \ -- 1.7.9