summaryrefslogtreecommitdiff
path: root/qmp.c
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2017-07-07 09:22:15 -0300
committerEduardo Habkost <ehabkost@redhat.com>2017-07-17 15:41:30 -0300
commitf86285c571c49e781d3fa46f3bef3835b8e6f393 (patch)
treea8a2327055d07499b3629548795f1c08da3d5558 /qmp.c
parent87467eae37e9b4727152292e09acead3ba3c95ed (diff)
downloadqemu-f86285c571c49e781d3fa46f3bef3835b8e6f393.tar.gz
qmp: Include parent type on 'qom-list-types' output
Include name of parent type of each type on 'qom-list-types' output. Without this, there's no way to figure out the parents of a given type without making additional 'qom-list-types' queries. In addition to the test case for the new feature, update the abstract-interface test case to use the new field and avoid the "qom-list-types implements=object" trick. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20170707122215.8819-4-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'qmp.c')
-rw-r--r--qmp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/qmp.c b/qmp.c
index 7a9de06af4..b86201e349 100644
--- a/qmp.c
+++ b/qmp.c
@@ -430,10 +430,15 @@ static void qom_list_types_tramp(ObjectClass *klass, void *data)
{
ObjectTypeInfoList *e, **pret = data;
ObjectTypeInfo *info;
+ ObjectClass *parent = object_class_get_parent(klass);
info = g_malloc0(sizeof(*info));
info->name = g_strdup(object_class_get_name(klass));
info->has_abstract = info->abstract = object_class_is_abstract(klass);
+ if (parent) {
+ info->has_parent = true;
+ info->parent = g_strdup(object_class_get_name(parent));
+ }
e = g_malloc0(sizeof(*e));
e->value = info;