[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 22/23] simplebench: bench_block_job: add cmd_options argument
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v4 22/23] simplebench: bench_block_job: add cmd_options argument |
Date: |
Sun, 17 Jan 2021 00:47:04 +0300 |
Add argument to allow additional block-job options.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
---
scripts/simplebench/bench-example.py | 2 +-
scripts/simplebench/bench_block_job.py | 11 +++++++----
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/scripts/simplebench/bench-example.py
b/scripts/simplebench/bench-example.py
index d9c7f7bc17..4864435f39 100644
--- a/scripts/simplebench/bench-example.py
+++ b/scripts/simplebench/bench-example.py
@@ -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'])
diff --git a/scripts/simplebench/bench_block_job.py
b/scripts/simplebench/bench_block_job.py
index a0dda1dc4e..7332845c1c 100755
--- a/scripts/simplebench/bench_block_job.py
+++ b/scripts/simplebench/bench_block_job.py
@@ -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)])
--
2.29.2
- [PATCH v4 19/23] block/block-copy: drop unused block_copy_set_progress_callback(), (continued)
- [PATCH v4 19/23] block/block-copy: drop unused block_copy_set_progress_callback(), Vladimir Sementsov-Ogievskiy, 2021/01/16
- [PATCH v4 12/23] iotests: 185: prepare for backup over block-copy, Vladimir Sementsov-Ogievskiy, 2021/01/16
- [PATCH v4 13/23] iotests: 219: prepare for backup over block-copy, Vladimir Sementsov-Ogievskiy, 2021/01/16
- [PATCH v4 16/23] block/backup: drop extra gotos from backup_run(), Vladimir Sementsov-Ogievskiy, 2021/01/16
- [PATCH v4 23/23] simplebench: add bench-backup.py, Vladimir Sementsov-Ogievskiy, 2021/01/16
- [PATCH v4 20/23] block/block-copy: drop unused argument of block_copy(), Vladimir Sementsov-Ogievskiy, 2021/01/16
- [PATCH v4 15/23] block/block-copy: make progress_bytes_callback optional, Vladimir Sementsov-Ogievskiy, 2021/01/16
- [PATCH v4 21/23] simplebench/bench_block_job: use correct shebang line with python3, Vladimir Sementsov-Ogievskiy, 2021/01/16
- [PATCH v4 18/23] qapi: backup: disable copy_range by default, Vladimir Sementsov-Ogievskiy, 2021/01/16
- [PATCH v4 22/23] simplebench: bench_block_job: add cmd_options argument,
Vladimir Sementsov-Ogievskiy <=
- [PATCH v4 17/23] backup: move to block-copy, Vladimir Sementsov-Ogievskiy, 2021/01/16
- [PATCH v4 14/23] iotests: 257: prepare for backup over block-copy, Vladimir Sementsov-Ogievskiy, 2021/01/16
- Re: [PATCH v4 00/23] backup performance: block_status + async, Max Reitz, 2021/01/18
- Re: [PATCH v4 00/23] backup performance: block_status + async, Max Reitz, 2021/01/19