[26/26] qdev: use object_property_help()
diff mbox series

Message ID 20191201111531.1136947-27-marcandre.lureau@redhat.com
State New
Headers show
Series
  • Make QDev use class properties
Related show

Commit Message

Marc-André Lureau Dec. 1, 2019, 11:15 a.m. UTC
Use the common function introduced earlier, and report default value.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 qdev-monitor.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

Patch
diff mbox series

diff --git a/qdev-monitor.c b/qdev-monitor.c
index e6b112eb0a..5a09031e53 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -286,16 +286,11 @@  int qdev_device_help(QemuOpts *opts)
         qemu_printf("There are no options for %s.\n", driver);
     }
     for (prop = prop_list; prop; prop = prop->next) {
-        int len;
-        qemu_printf("  %s=<%s>%n", prop->value->name, prop->value->type, &len);
-        if (prop->value->has_description) {
-            if (len < 24) {
-                qemu_printf("%*s", 24 - len, "");
-            }
-            qemu_printf(" - %s\n", prop->value->description);
-        } else {
-            qemu_printf("\n");
-        }
+        g_autofree char *help = object_property_help(prop->value->name,
+                                                     prop->value->type,
+                                                     prop->value->default_value,
+                                                     prop->value->description);
+        qemu_printf("%s\n", help);
     }
 
     qapi_free_ObjectPropertyInfoList(prop_list);