On 2013年11月21日 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" = "$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.
I thought Kevin wanted to override the cache mode (if not given by
user), so the cases doesn't get skipped by default. I also feel that a
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
will not have a "implicit yet forced" cache mode any more.
On 2013年11月19日 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 check
> 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 differs
> 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