vditest: use given/when instead of switch/case

This patch uses the given/when statement instead of switch/case
because Switch.pm is deprecated.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
vditest: don't flush when '-f 0' is specified

We can use '-f 1' to flush every write, so let's use '-f 0' as an
option to avoid flushing.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
vditest: remove error() and use built-in function

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
vditest: remove data verification

We unlikely to use vditest for other than benchmark tests.  For such
purposes, use qemu-iotests and ./script/check.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
vditest: add helper function to simplify code

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
vditest: flush based on write counts

It doesn't make sense to flush after read requests.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>