[libvirt PATCH 24/29] cpu-gather: Ignore empty responses from qemu

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx>
---
 tests/cputestdata/cpu-gather.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/cputestdata/cpu-gather.py b/tests/cputestdata/cpu-gather.py
index b6acae9eb7..10dbeb87cf 100755
--- a/tests/cputestdata/cpu-gather.py
+++ b/tests/cputestdata/cpu-gather.py
@@ -93,8 +93,12 @@ def call_qemu(qemu, qmp_cmds):
         exit("Error: File not found: '{}'.".format(qemu))
 
     for line in output.split("\n"):
-        if line:
-            yield json.loads(line)
+        if not line:
+            continue
+        response = json.loads(line)
+        if "return" in response and not response["return"]:
+            continue
+        yield response
 
 
 def gather_model(args):
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux