aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>2021-02-19 18:16:14 +0300
committerVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>2021-05-04 11:37:26 +0300
commit4ad7a5c06535d36d955928cac0352be13cf6f712 (patch)
tree8a5157bed48baf63acce01d478e22748c26738e6 /scripts
parent684d18efd1a35b75a6625072c68e1b7ea70bd3a8 (diff)
downloadqemu-4ad7a5c06535d36d955928cac0352be13cf6f712.zip
qemu-4ad7a5c06535d36d955928cac0352be13cf6f712.tar.gz
qemu-4ad7a5c06535d36d955928cac0352be13cf6f712.tar.bz2
simplebench/bench_block_job: handle error in BLOCK_JOB_COMPLETED
We should not report success if there is an error in final event. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/simplebench/bench_block_job.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/simplebench/bench_block_job.py b/scripts/simplebench/bench_block_job.py
index 8f8385c..71d2e48 100755
--- a/scripts/simplebench/bench_block_job.py
+++ b/scripts/simplebench/bench_block_job.py
@@ -70,6 +70,10 @@ def bench_block_job(cmd, cmd_args, qemu_args):
vm.shutdown()
return {'error': 'block-job failed: ' + str(e),
'vm-log': vm.get_log()}
+ if 'error' in e['data']:
+ vm.shutdown()
+ return {'error': 'block-job failed: ' + e['data']['error'],
+ 'vm-log': vm.get_log()}
end_ms = e['timestamp']['seconds'] * 1000000 + \
e['timestamp']['microseconds']
finally: