]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu-replies-tool: Dump also query string for optional members
authorPeter Krempa <pkrempa@redhat.com>
Mon, 10 Feb 2025 17:29:14 +0000 (18:29 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 12 Feb 2025 15:22:56 +0000 (16:22 +0100)
The query language allows querying whether a member is optional by using
the '*' "operator" but the dumper script didn't output those query
strings.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
scripts/qemu-replies-tool.py

index 1fcd2c49821c914f22a3ad11b035f483a67f1d8a..6d474a83f23968d254a5510bb936e591d89daf82 100755 (executable)
@@ -336,6 +336,10 @@ def dump_qmp_probe_strings_iter(name, cur, trace, schema):
             membpath = "%s/%s" % (cur, memb['name'])
             print(membpath)
 
+            # object members can be queried for optionality by '*'
+            if 'default' in memb:
+                print("%s/*%s" % (cur, memb['name']))
+
             for f in memb.get('features', []):
                 print('%s/$%s' % (membpath, f))