]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu-replies-tool: Fix logic error when dumping device properties
authorPeter Krempa <pkrempa@redhat.com>
Tue, 7 Oct 2025 09:42:41 +0000 (11:42 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 8 Oct 2025 07:24:26 +0000 (09:24 +0200)
In a recent refactor the block of code outputting device properties was
mis-indented causing it to only work on device properties which have no
'default-value'.

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

index cf99ecd1f3a2a4d96ea18626cc37ed4af951c6ad..21401452cfa1209e273c9694bb0fa01b910f2e83 100755 (executable)
@@ -436,16 +436,16 @@ def dump_device_and_object_properties(conv, dumpprefix):
                 if k not in ['name', 'type', 'description', 'default-value']:
                     raise Exception("Unhandled 'device-list-properties'/'qom-list-properties' typename '%s' field '%s'" % (c['cmd']['arguments']['typename'], k))
 
-                if 'default-value' in arg:
-                    defval = ' (%s)' % str(arg['default-value'])
-                else:
-                    defval = ''
-
-                    ent.append('%s %s %s %s%s' % (prefix,
-                                                  c['cmd']['arguments']['typename'],
-                                                  arg['name'],
-                                                  arg['type'],
-                                                  defval))
+            if 'default-value' in arg:
+                defval = ' (%s)' % str(arg['default-value'])
+            else:
+                defval = ''
+
+            ent.append('%s %s %s %s%s' % (prefix,
+                                          c['cmd']['arguments']['typename'],
+                                          arg['name'],
+                                          arg['type'],
+                                          defval))
     ent.sort()
 
     for e in ent: