From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60935) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjTYI-0007HT-BT for qemu-devel@nongnu.org; Thu, 21 Nov 2013 07:40:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VjTY9-0005zS-VK for qemu-devel@nongnu.org; Thu, 21 Nov 2013 07:40:10 -0500 Received: from mail-we0-x22d.google.com ([2a00:1450:400c:c03::22d]:48020) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VjTY9-0005z9-PF for qemu-devel@nongnu.org; Thu, 21 Nov 2013 07:40:01 -0500 Received: by mail-we0-f173.google.com with SMTP id t61so3882442wes.18 for ; Thu, 21 Nov 2013 04:40:00 -0800 (PST) Date: Thu, 21 Nov 2013 13:39:57 +0100 From: Stefan Hajnoczi Message-ID: <20131121123957.GA7466@stefanha-thinkpad.redhat.com> References: <1384933457-26953-1-git-send-email-famz@redhat.com> <1384933457-26953-4-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1384933457-26953-4-git-send-email-famz@redhat.com> 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: Fam Zheng Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, WenchaoXia 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" = "$opt" ] > - then > - _notrun "not suitable for qemu-io option: $bad_opt" > - fi > - done > + if $CACHEMODE_IS_DEFAULT; then > + QEMU_IO="$QEMU_IO -t $1" > + return > + fi > + for mode; do > + if [ "$mode" = "$CACHEMODE" ]; then > + return > + fi > done > + _notrun "not suitable for cache mode: $CACHEMODE" > } This seems weird to me: By default tests run with CACHEMODE=writethrough but test cases can use _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. Stefan