Received: from eggs.gnu.org ([2001:4830:134:3::10]:38395) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgmbP-0008FZ-Rj for qemu-devel@nongnu.org; Wed, 13 Nov 2013 21:24:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VgmbJ-0005kR-S1 for qemu-devel@nongnu.org; Wed, 13 Nov 2013 21:24:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:6482) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VgmbJ-0005kL-Is for qemu-devel@nongnu.org; Wed, 13 Nov 2013 21:24:09 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rAE2O8x5026084 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 13 Nov 2013 21:24:08 -0500 From: Fam Zheng Date: Thu, 14 Nov 2013 10:24:04 +0800 Message-Id: <1384395844-21926-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH] qemu-iotests: Add "-c " to check List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, stefanha@redhat.com The default cache mode for drive options is changed to writethrough, and overridable with "./check -c ". Signed-off-by: Fam Zheng --- tests/qemu-iotests/common | 13 ++++++++++++- tests/qemu-iotests/iotests.py | 3 ++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common index 2932e14..f870c52 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 @@ -259,6 +266,10 @@ testlist options imgopts=true xpand=false ;; + -c) + cachemode=true + xpand=false + ;; -r) # randomize test order randomize=true xpand=false diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index fb10ff4..c84a1a5 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -37,6 +37,7 @@ qemu_args = os.environ.get('QEMU', 'qemu').strip().split(' ') imgfmt = os.environ.get('IMGFMT', 'raw') imgproto = os.environ.get('IMGPROTO', 'file') test_dir = os.environ.get('TEST_DIR', '/var/tmp') +cachemode = os.environ.get('CACHEMODE') socket_scm_helper = os.environ.get('SOCKET_SCM_HELPER', 'socket_scm_helper') @@ -96,7 +97,7 @@ class VM(object): '''Add a virtio-blk drive to the VM''' options = ['if=virtio', 'format=%s' % imgfmt, - 'cache=none', + 'cache=%s' % cachemode, 'file=%s' % path, 'id=drive%d' % self._num_drives] if opts: -- 1.8.4.2