From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55376) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vif4O-0004YE-24 for qemu-devel@nongnu.org; Tue, 19 Nov 2013 01:46:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vif4I-0004VQ-2A for qemu-devel@nongnu.org; Tue, 19 Nov 2013 01:45:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:11498) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vif4H-0004VM-Oq for qemu-devel@nongnu.org; Tue, 19 Nov 2013 01:45:49 -0500 From: Fam Zheng Date: Tue, 19 Nov 2013 14:45:36 +0800 Message-Id: <1384843537-14112-2-git-send-email-famz@redhat.com> In-Reply-To: <1384843537-14112-1-git-send-email-famz@redhat.com> References: <1384843537-14112-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH v2 1/2] qemu-iotests: Add "-c " option List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, Wenchao Xia , stefanha@redhat.com The option sets cache mode used in the tests. "-nocache" is changed to an alias to "-c none", and internally passes "-t none" to qemu-io. Python scripts will make use of option this in the next commit. Signed-off-by: Fam Zheng --- tests/qemu-iotests/common | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common index 8cde7f1..5314314 100644 --- a/tests/qemu-iotests/common +++ b/tests/qemu-iotests/common @@ -42,12 +42,14 @@ expunge=true have_test_arg=false randomize=false valgrind=false +cachemode=false rm -f $tmp.list $tmp.tmp $tmp.sed export IMGFMT=raw export IMGFMT_GENERIC=true export IMGPROTO=file export IMGOPTS="" +export CACHEMODE="writethrough" export QEMU_IO_OPTIONS="" for r @@ -113,7 +115,11 @@ s/ .*//p IMGOPTS="$r" imgopts=false continue - + elif $cachemode + then + CACHEMODE="$r" + cachemode=false + continue fi xpand=true @@ -147,6 +153,7 @@ check options -o options -o options to pass to qemu-img create/convert -T output timestamps -r randomize test order + -c cache mode testlist options -g group[,group...] include tests from these groups @@ -219,7 +226,7 @@ testlist options xpand=false ;; -nocache) - QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS --nocache" + CACHEMODE="none" xpand=false ;; @@ -258,6 +265,10 @@ testlist options imgopts=true xpand=false ;; + -c) + cachemode=true + xpand=false + ;; -r) # randomize test order randomize=true xpand=false @@ -334,6 +345,9 @@ BEGIN { for (t='$start'; t<='$end'; t++) printf "%03d\n",t }' \ done +# Set qemu-io cache mode with $CACHEMODE we have +QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS -t $CACHEMODE" + # Set default options for qemu-img create -o if they were not specified _set_default_imgopts -- 1.8.4.2