]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
cpu-gather: Ignore empty responses from qemu
authorTim Wiederhake <twiederh@redhat.com>
Tue, 15 Dec 2020 16:25:10 +0000 (17:25 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 18 Dec 2020 22:20:46 +0000 (23:20 +0100)
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
tests/cputestdata/cpu-gather.py

index b6acae9eb7df36ed1fd2421fb20c27b55a77a9ca..10dbeb87cf001410dc1a78249e83293ab5251cf4 100755 (executable)
@@ -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):