]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
scripts: qemu-replies-tool: Add stable dump of 'query-command-line-options'
authorPeter Krempa <pkrempa@redhat.com>
Fri, 29 Aug 2025 13:10:36 +0000 (15:10 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 2 Sep 2025 08:55:24 +0000 (10:55 +0200)
While 'query-command-line-options' is usually fairly stable (for
comparing between two .replies files) it's simpler to compare it in the
dumped variant.

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

index 7cda1d57adaf70236a702bc9569c503b112b9815..e5a1b2fb3ed7b4d8fb7044736168e62f241f30cb 100755 (executable)
@@ -500,6 +500,19 @@ def dump_machine_types(conv, dumpprefix):
         print(dumpprefix + '(machine alias) ' + a)
 
 
+def dump_command_line_options(c, dumpprefix):
+    optpar = []
+
+    for opt in c['rep']['return']:
+        for par in opt['parameters']:
+            optpar.append('%s %s' % (opt['option'], par['name']))
+
+    optpar.sort()
+
+    for o in optpar:
+        print(dumpprefix + '(cl-opt) ' + o)
+
+
 def dump_other(conv, dumpprefix):
     for c in conv:
         if c['cmd']['execute'] == 'query-version':
@@ -517,6 +530,9 @@ def dump_other(conv, dumpprefix):
                                                      c['rep']['return']['present'],
                                                      c['rep']['return']['enabled']))
 
+        if c['cmd']['execute'] == 'query-command-line-options':
+            dump_command_line_options(c, dumpprefix)
+
 
 def process_one(filename, args):
     try: