Skip to content
Snippets Groups Projects
Commit 1bb3d7d9 authored by Marc-André Lureau's avatar Marc-André Lureau Committed by Paolo Bonzini
Browse files

qapi/qmp: add ObjectPropertyInfo.default-value


Report the default value associated with a property.

Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20200110153039.1379601-26-marcandre.lureau@redhat.com>
[Report it as type "any", not string. - Paolo]
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 4df81616
No related branches found
No related tags found
No related merge requests found
......@@ -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:
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment