22c213
From a3778aef0be61dead835af39073a62bbf72c8e20 Mon Sep 17 00:00:00 2001
22c213
From: Kevin Wolf <kwolf@redhat.com>
22c213
Date: Fri, 7 Feb 2020 11:23:59 +0000
22c213
Subject: [PATCH 02/18] iotests: Support job-complete in run_job()
22c213
22c213
RH-Author: Kevin Wolf <kwolf@redhat.com>
22c213
Message-id: <20200207112404.25198-2-kwolf@redhat.com>
22c213
Patchwork-id: 93746
22c213
O-Subject: [RHEL-AV-8.2.0 qemu-kvm PATCH v2 1/6] iotests: Support job-complete in run_job()
22c213
Bugzilla: 1781637
22c213
RH-Acked-by: Sergio Lopez Pascual <slp@redhat.com>
22c213
RH-Acked-by: Max Reitz <mreitz@redhat.com>
22c213
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
22c213
22c213
Automatically complete jobs that have a 'ready' state and need an
22c213
explicit job-complete. Without this, run_job() would hang for such
22c213
jobs.
22c213
22c213
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
22c213
Reviewed-by: Eric Blake <eblake@redhat.com>
22c213
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
22c213
Reviewed-by: Alberto Garcia <berto@igalia.com>
22c213
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
22c213
(cherry picked from commit 4688c4e32ec76004676470f11734478799673d6d)
22c213
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
22c213
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
22c213
---
22c213
 tests/qemu-iotests/iotests.py | 2 ++
22c213
 1 file changed, 2 insertions(+)
22c213
22c213
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
22c213
index df07089..3cff671 100644
22c213
--- a/tests/qemu-iotests/iotests.py
22c213
+++ b/tests/qemu-iotests/iotests.py
22c213
@@ -617,6 +617,8 @@ class VM(qtest.QEMUQtestMachine):
22c213
                         error = j['error']
22c213
                         if use_log:
22c213
                             log('Job failed: %s' % (j['error']))
22c213
+            elif status == 'ready':
22c213
+                self.qmp_log('job-complete', id=job)
22c213
             elif status == 'pending' and not auto_finalize:
22c213
                 if pre_finalize:
22c213
                     pre_finalize()
22c213
-- 
22c213
1.8.3.1
22c213