mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
qmp: Include 'abstract' field on 'qom-list-types' output
A client may be interested in getting the list of both abstract and non-abstract types. Instead of requiring them to make multiple queries with different filter arguments, just return an 'abstract' field in 'qom-list-types'. In addition to the new test code for validating this field, update the abstract-interfaces test case to query for all 'interface' subtypes (including abstract ones), and to look at the 'abstract' field directly. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20170707122215.8819-3-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
dbb2a604a9
commit
87467eae37
3 changed files with 45 additions and 14 deletions
1
qmp.c
1
qmp.c
|
@ -433,6 +433,7 @@ static void qom_list_types_tramp(ObjectClass *klass, void *data)
|
|||
|
||||
info = g_malloc0(sizeof(*info));
|
||||
info->name = g_strdup(object_class_get_name(klass));
|
||||
info->has_abstract = info->abstract = object_class_is_abstract(klass);
|
||||
|
||||
e = g_malloc0(sizeof(*e));
|
||||
e->value = info;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue