]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
scripts: qemu-replies-tool: Dump data from query-version/query-target/query-kvm
authorPeter Krempa <pkrempa@redhat.com>
Fri, 29 Aug 2025 13:08:18 +0000 (15:08 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 2 Sep 2025 08:55:24 +0000 (10:55 +0200)
Process few other simple commands. While this output doesn't change
places it's useful to see it when comparing the dumps of two .replies
files.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
scripts/qemu-replies-tool.py

index 8e48268456317769e048eba2a2b55670c99b7234..7cda1d57adaf70236a702bc9569c503b112b9815 100755 (executable)
@@ -500,6 +500,24 @@ def dump_machine_types(conv, dumpprefix):
         print(dumpprefix + '(machine alias) ' + a)
 
 
+def dump_other(conv, dumpprefix):
+    for c in conv:
+        if c['cmd']['execute'] == 'query-version':
+            print('%s(version) %s.%s.%s %s' % (dumpprefix,
+                                               c['rep']['return']['qemu']['major'],
+                                               c['rep']['return']['qemu']['minor'],
+                                               c['rep']['return']['qemu']['micro'],
+                                               c['rep']['return']['package']))
+
+        if c['cmd']['execute'] == 'query-target':
+            print('%s(target) %s' % (dumpprefix, c['rep']['return']['arch']))
+
+        if c['cmd']['execute'] == 'query-kvm':
+            print('%s(kvm) present:%s enabled:%s' % (dumpprefix,
+                                                     c['rep']['return']['present'],
+                                                     c['rep']['return']['enabled']))
+
+
 def process_one(filename, args):
     try:
         conv = qemu_replies_load(filename)
@@ -520,6 +538,7 @@ def process_one(filename, args):
                     dumped = True
 
         if args.dump_all:
+            dump_other(conv, dumpprefix)
             dump_qom_list_types(conv, dumpprefix)
             dump_device_and_object_properties(conv, dumpprefix)
             dump_machine_types(conv, dumpprefix)