From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34172) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjTei-0003CW-EI for qemu-devel@nongnu.org; Thu, 21 Nov 2013 07:46:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VjTec-000836-2G for qemu-devel@nongnu.org; Thu, 21 Nov 2013 07:46:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:2878) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjTeb-00082w-Ql for qemu-devel@nongnu.org; Thu, 21 Nov 2013 07:46:41 -0500 Message-ID: <528E00A7.3010900@redhat.com> Date: Thu, 21 Nov 2013 20:46:31 +0800 From: Fam Zheng MIME-Version: 1.0 References: <1384933457-26953-1-git-send-email-famz@redhat.com> <1384933457-26953-4-git-send-email-famz@redhat.com> <20131121123957.GA7466@stefanha-thinkpad.redhat.com> In-Reply-To: <20131121123957.GA7466@stefanha-thinkpad.redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 3/6] qemu-iotests: Add _supported_cache_modes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, WenchaoXia On 2013=E5=B9=B411=E6=9C=8821=E6=97=A5 20:39, Stefan Hajnoczi wrote: > On Wed, Nov 20, 2013 at 03:44:14PM +0800, Fam Zheng wrote: >> -_unsupported_qemu_io_options() >> +_supported_cache_modes() >> { >> - for bad_opt >> - do >> - for opt in $QEMU_IO_OPTIONS >> - do >> - if [ "$bad_opt" =3D "$opt" ] >> - then >> - _notrun "not suitable for qemu-io option: $bad_opt" >> - fi >> - done >> + if $CACHEMODE_IS_DEFAULT; then >> + QEMU_IO=3D"$QEMU_IO -t $1" >> + return >> + fi >> + for mode; do >> + if [ "$mode" =3D "$CACHEMODE" ]; then >> + return >> + fi >> done >> + _notrun "not suitable for cache mode: $CACHEMODE" >> } > > This seems weird to me: > By default tests run with CACHEMODE=3Dwritethrough but test cases can u= se > _supported_cache_modes() to switch to a different "default" behind the > scenes? > > Why not keep it simple: > If a test doesn't support CACHEMODE, it gets skipped. > I thought Kevin wanted to override the cache mode (if not given by=20 user), so the cases doesn't get skipped by default. I also feel that a=20 test case used to actually run by default shouldn't be skipped unnoticed. I'm basically adding a meta cache mode "default" here, which means we=20 will not have a "implicit yet forced" cache mode any more. On 2013=E5=B9=B411=E6=9C=8819=E6=97=A5 18:21, Kevin Wolf wrote: > > Okay, I gave it some testing, too, and it looks like we need some > additional changes. There are some test cases that use: > > _unsupported_qemu_io_options --nocache > > Which obviously doesn't work any more. We need to replace it by a chec= k > against $CACHEMODE (or, perhaps preferably, even override it > automatically, so that test cases aren't left out just because of the > cache mode) > > Test case 026 uses the option of having a 026.out.nocache, which diffe= rs > from the normal output. I suspect the correct differentiation is here > between writethrough and writeback modes. And of course, grepping for > '--nocache' to detect the condition doesn't work any more. > > Kevin > Fam