[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 52/59] vl: print default value in object help
From: |
Paolo Bonzini |
Subject: |
[PULL 52/59] vl: print default value in object help |
Date: |
Thu, 23 Jan 2020 14:50:42 +0100 |
From: Marc-André Lureau <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
qom/object_interfaces.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c
index 46cd6ea..edb4cc4 100644
--- a/qom/object_interfaces.c
+++ b/qom/object_interfaces.c
@@ -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, "");
--
1.8.3.1
- [PULL 40/59] object: do not free class properties, (continued)
- [PULL 40/59] object: do not free class properties, Paolo Bonzini, 2020/01/23
- [PULL 41/59] object: check strong flag with &, Paolo Bonzini, 2020/01/23
- [PULL 42/59] object: rename link "child" to "target", Paolo Bonzini, 2020/01/23
- [PULL 43/59] object: add direct link flag, Paolo Bonzini, 2020/01/23
- [PULL 44/59] object: express const link with link property, Paolo Bonzini, 2020/01/23
- [PULL 45/59] object: add object_class_property_add_link(), Paolo Bonzini, 2020/01/23
- [PULL 46/59] object: release all props, Paolo Bonzini, 2020/01/23
- [PULL 47/59] object: return self in object_ref(), Paolo Bonzini, 2020/01/23
- [PULL 49/59] qdev: rename DeviceClass.props, Paolo Bonzini, 2020/01/23
- [PULL 50/59] qdev: move instance properties to class properties, Paolo Bonzini, 2020/01/23
- [PULL 52/59] vl: print default value in object help,
Paolo Bonzini <=
- [PULL 51/59] qdev: register properties as class properties, Paolo Bonzini, 2020/01/23
- [PULL 53/59] qom: simplify qmp_device_list_properties(), Paolo Bonzini, 2020/01/23
- [PULL 54/59] qom: introduce object_property_help(), Paolo Bonzini, 2020/01/23
- [PULL 55/59] qapi/qmp: add ObjectPropertyInfo.default-value, Paolo Bonzini, 2020/01/23
- [PULL 56/59] qdev: use object_property_help(), Paolo Bonzini, 2020/01/23
- [PULL 57/59] target/i386: Add the 'model-id' for Skylake -v3 CPU models, Paolo Bonzini, 2020/01/23
- [PULL 59/59] tests: fix test-qga on macosx, Paolo Bonzini, 2020/01/23
- [PULL 58/59] build-sys: clean up flags included in the linker command line, Paolo Bonzini, 2020/01/23
- [PULL 48/59] qdev: set properties with device_class_set_props(), Paolo Bonzini, 2020/01/23
- Re: [PULL v2 00/59] Misc (x86 and QOM) patches for 2020-01-23, Peter Maydell, 2020/01/23