[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 55/59] qapi/qmp: add ObjectPropertyInfo.default-value
From: |
Paolo Bonzini |
Subject: |
[PULL 55/59] qapi/qmp: add ObjectPropertyInfo.default-value |
Date: |
Thu, 23 Jan 2020 14:50:45 +0100 |
From: Marc-André Lureau <address@hidden>
Report the default value associated with a property.
Signed-off-by: Marc-André Lureau <address@hidden>
Message-Id: <address@hidden>
[Report it as type "any", not string. - Paolo]
Signed-off-by: Paolo Bonzini <address@hidden>
---
qapi/qom.json | 7 ++++++-
qom/qom-qmp-cmds.c | 2 ++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/qapi/qom.json b/qapi/qom.json
index 32db96f..1e3c2ad 100644
--- a/qapi/qom.json
+++ b/qapi/qom.json
@@ -26,10 +26,15 @@
#
# @description: if specified, the description of the property.
#
+# @default-value: the default value, if any (since 5.0)
+#
# Since: 1.2
##
{ 'struct': 'ObjectPropertyInfo',
- 'data': { 'name': 'str', 'type': 'str', '*description': 'str' } }
+ 'data': { 'name': 'str',
+ 'type': 'str',
+ '*description': 'str',
+ '*default-value': 'any' } }
##
# @qom-list:
diff --git a/qom/qom-qmp-cmds.c b/qom/qom-qmp-cmds.c
index 8785816..6136efe 100644
--- a/qom/qom-qmp-cmds.c
+++ b/qom/qom-qmp-cmds.c
@@ -177,6 +177,8 @@ ObjectPropertyInfoList *qmp_device_list_properties(const
char *typename,
info->type = g_strdup(prop->type);
info->has_description = !!prop->description;
info->description = g_strdup(prop->description);
+ info->default_value = qobject_ref(prop->defval);
+ info->has_default_value = !!info->default_value;
entry = g_malloc0(sizeof(*entry));
entry->value = info;
--
1.8.3.1
- [PULL 44/59] object: express const link with link property, (continued)
- [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, 2020/01/23
- [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 <=
- [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
- [PULL v2 00/59] Misc (x86 and QOM) patches for 2020-01-23, Paolo Bonzini, 2020/01/24