]> Git Repo - qemu.git/commitdiff
vl: print default value in object help
authorMarc-André Lureau <[email protected]>
Fri, 10 Jan 2020 15:30:35 +0000 (19:30 +0400)
committerPaolo Bonzini <[email protected]>
Fri, 24 Jan 2020 19:59:16 +0000 (20:59 +0100)
Signed-off-by: Marc-André Lureau <[email protected]>
Message-Id: <20200110153039.1379601[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
qom/object_interfaces.c

index 46cd6eab5c6b61b783760d189d239b68d958ce62..edb4cc4a3dd4f50f299848827bf311a7fc19e161 100644 (file)
@@ -185,6 +185,7 @@ bool user_creatable_print_help(const char *type, QemuOpts *opts)
         object_class_property_iter_init(&iter, klass);
         while ((prop = object_property_iter_next(&iter))) {
             GString *str;
+            char *defval;
 
             if (!prop->set) {
                 continue;
@@ -192,6 +193,11 @@ bool user_creatable_print_help(const char *type, QemuOpts *opts)
 
             str = g_string_new(NULL);
             g_string_append_printf(str, "  %s=<%s>", prop->name, prop->type);
+            defval = object_property_get_default(prop);
+            if (defval) {
+                g_string_append_printf(str, " (default: %s)", defval);
+                g_free(defval);
+            }
             if (prop->description) {
                 if (str->len < 24) {
                     g_string_append_printf(str, "%*s", 24 - (int)str->len, "");
This page took 0.02627 seconds and 4 git commands to generate.