From patchwork Fri Dec 6 16:36:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 298087 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4F0C92C00AD for ; Sat, 7 Dec 2013 03:50:08 +1100 (EST) Received: from localhost ([::1]:60092 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoybN-0006DG-Rw for incoming@patchwork.ozlabs.org; Fri, 06 Dec 2013 11:50:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoyPh-0007zO-DB for qemu-devel@nongnu.org; Fri, 06 Dec 2013 11:38:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VoyPb-0003UJ-BR for qemu-devel@nongnu.org; Fri, 06 Dec 2013 11:38:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:30910) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoyPb-0003UB-3i for qemu-devel@nongnu.org; Fri, 06 Dec 2013 11:37:55 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rB6GbqP7023452 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 6 Dec 2013 11:37:53 -0500 Received: from localhost (ovpn-112-22.ams2.redhat.com [10.36.112.22]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rB6GbpID025445; Fri, 6 Dec 2013 11:37:51 -0500 From: Stefan Hajnoczi To: Date: Fri, 6 Dec 2013 17:36:24 +0100 Message-Id: <1386347807-27359-26-git-send-email-stefanha@redhat.com> In-Reply-To: <1386347807-27359-1-git-send-email-stefanha@redhat.com> References: <1386347807-27359-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Fam Zheng , Stefan Hajnoczi , Anthony Liguori Subject: [Qemu-devel] [PULL 25/48] qemu-iotests: Add "-c " option X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Fam Zheng 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 Reviewed-by: Wenchao Xia Signed-off-by: Stefan Hajnoczi --- tests/qemu-iotests/check | 2 +- tests/qemu-iotests/common | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index f5f328f..dc0105c 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -242,7 +242,7 @@ do fi reference=$seq.out - if (echo $QEMU_IO_OPTIONS | grep -s -- '--nocache' > /dev/null); then + if [ "$CACHEMODE" = "none" ]; then [ -f $seq.out.nocache ] && reference=$seq.out.nocache fi diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common index 8cde7f1..4743c9e 100644 --- a/tests/qemu-iotests/common +++ b/tests/qemu-iotests/common @@ -42,13 +42,16 @@ 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="" +export CACHEMODE_IS_DEFAULT=true for r do @@ -113,7 +116,12 @@ s/ .*//p IMGOPTS="$r" imgopts=false continue - + elif $cachemode + then + CACHEMODE="$r" + CACHEMODE_IS_DEFAULT=false + cachemode=false + continue fi xpand=true @@ -147,6 +155,7 @@ check options -o options -o options to pass to qemu-img create/convert -T output timestamps -r randomize test order + -c mode cache mode testlist options -g group[,group...] include tests from these groups @@ -219,7 +228,8 @@ testlist options xpand=false ;; -nocache) - QEMU_IO_OPTIONS="$QEMU_IO_OPTIONS --nocache" + CACHEMODE="none" + CACHEMODE_IS_DEFAULT=false xpand=false ;; @@ -258,6 +268,10 @@ testlist options imgopts=true xpand=false ;; + -c) + cachemode=true + xpand=false + ;; -r) # randomize test order randomize=true xpand=false @@ -334,6 +348,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 --cache $CACHEMODE" + # Set default options for qemu-img create -o if they were not specified _set_default_imgopts