simplebench: bench_block_job: add cmd_options argument
Add argument to allow additional block-job options. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-Id: <20210116214705.822267-23-vsementsov@virtuozzo.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
parent
2096de521e
commit
b2fcb0c575
@ -25,7 +25,7 @@ from bench_block_job import bench_block_copy, drv_file, drv_nbd
|
||||
|
||||
def bench_func(env, case):
|
||||
""" Handle one "cell" of benchmarking table. """
|
||||
return bench_block_copy(env['qemu_binary'], env['cmd'],
|
||||
return bench_block_copy(env['qemu_binary'], env['cmd'], {}
|
||||
case['source'], case['target'])
|
||||
|
||||
|
||||
|
@ -78,16 +78,19 @@ def bench_block_job(cmd, cmd_args, qemu_args):
|
||||
|
||||
|
||||
# Bench backup or mirror
|
||||
def bench_block_copy(qemu_binary, cmd, source, target):
|
||||
def bench_block_copy(qemu_binary, cmd, cmd_options, source, target):
|
||||
"""Helper to run bench_block_job() for mirror or backup"""
|
||||
assert cmd in ('blockdev-backup', 'blockdev-mirror')
|
||||
|
||||
source['node-name'] = 'source'
|
||||
target['node-name'] = 'target'
|
||||
|
||||
return bench_block_job(cmd,
|
||||
{'job-id': 'job0', 'device': 'source',
|
||||
'target': 'target', 'sync': 'full'},
|
||||
cmd_options['job-id'] = 'job0'
|
||||
cmd_options['device'] = 'source'
|
||||
cmd_options['target'] = 'target'
|
||||
cmd_options['sync'] = 'full'
|
||||
|
||||
return bench_block_job(cmd, cmd_options,
|
||||
[qemu_binary,
|
||||
'-blockdev', json.dumps(source),
|
||||
'-blockdev', json.dumps(target)])
|
||||
|
Loading…
Reference in New Issue
Block a user