@@ -442,7 +442,8 @@ ObjectTypeInfoList *qmp_qom_list_types(bool has_implements,
*/
static DevicePropertyInfo *make_device_property_info(ObjectClass *klass,
const char *name,
- const char *default_type)
+ const char *default_type,
+ const char *description)
{
DevicePropertyInfo *info;
Property *prop;
@@ -465,7 +466,12 @@ static DevicePropertyInfo *make_device_property_info(ObjectClass *klass,
info = g_malloc0(sizeof(*info));
info->name = g_strdup(prop->name);
- info->type = g_strdup(prop->info->legacy_name ?: prop->info->name);
+ if (prop->info->description) {
+ info->type = g_strdup_printf("%s (%s)", prop->info->name,
+ prop->info->description);
+ } else {
+ info->type = g_strdup(prop->info->name);
+ }
return info;
}
klass = object_class_get_parent(klass);
@@ -474,7 +480,11 @@ static DevicePropertyInfo *make_device_property_info(ObjectClass *klass,
/* Not a qdev property, use the default type */
info = g_malloc0(sizeof(*info));
info->name = g_strdup(name);
- info->type = g_strdup(default_type);
+ if (description) {
+ info->type = g_strdup_printf("%s (%s)", default_type, description);
+ } else {
+ info->type = g_strdup(default_type);
+ }
return info;
}
@@ -521,7 +531,8 @@ DevicePropertyInfoList *qmp_device_list_properties(const char *typename,
continue;
}
- info = make_device_property_info(klass, prop->name, prop->type);
+ info = make_device_property_info(klass, prop->name, prop->type,
+ prop->description);
if (!info) {
continue;
}