On 3/4/21 5:17 AM, Vladimir Sementsov-Ogievskiy wrote:
We should not report success if there is an error in final event.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com>
---
scripts/simplebench/bench_block_job.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/scripts/simplebench/bench_block_job.py
b/scripts/simplebench/bench_block_job.py
index 8f8385ccce..71d2e489c8 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:
"Yes, the block job completed -- but not how you wanted it to."
Reviewed-by: John Snow <js...@redhat.com>