simplebench/bench-backup: add target-cache argument

Allow benchmark with different kinds of target cache.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: John Snow <jsnow@redhat.com>
This commit is contained in:
Vladimir Sementsov-Ogievskiy 2021-01-28 13:28:17 +03:00
parent af2ac8514f
commit 684d18efd1
2 changed files with 33 additions and 10 deletions

View file

@ -115,9 +115,13 @@ def bench_block_copy(qemu_binary, cmd, cmd_options, source, target):
'-blockdev', json.dumps(target)])
def drv_file(filename):
return {'driver': 'file', 'filename': filename,
'cache': {'direct': True}, 'aio': 'native'}
def drv_file(filename, o_direct=True):
node = {'driver': 'file', 'filename': filename}
if o_direct:
node['cache'] = {'direct': True}
node['aio'] = 'native'
return node
def drv_nbd(host, port):