yeahuh / rpms / qemu-kvm

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