diff mbox series

[PULL,5/9] simplebench/bench_block_job: handle error in BLOCK_JOB_COMPLETED

Message ID 20210504090113.21311-6-vsementsov@virtuozzo.com (mailing list archive)
State New, archived
Headers show
Series [PULL,1/9] simplebench: bench_one(): add slow_limit argument | expand

Commit Message

Vladimir Sementsov-Ogievskiy May 4, 2021, 9:01 a.m. UTC
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>
---
 scripts/simplebench/bench_block_job.py | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

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: