mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
qom: Make all interface types abstract
"qom-list-types abstract=false" currently returns all interface types, as if they were not abstract. Fix this by making sure all interface types are abstract. All interface types have instance_size == 0, so we can use it to set abstract=true on type_initialize(). Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <1481567461-2341-1-git-send-email-ehabkost@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
765a707000
commit
1c6d75d5f7
2 changed files with 63 additions and 3 deletions
|
@ -272,6 +272,12 @@ static void type_initialize(TypeImpl *ti)
|
|||
|
||||
ti->class_size = type_class_get_size(ti);
|
||||
ti->instance_size = type_object_get_size(ti);
|
||||
/* Any type with zero instance_size is implicitly abstract.
|
||||
* This means interface types are all abstract.
|
||||
*/
|
||||
if (ti->instance_size == 0) {
|
||||
ti->abstract = true;
|
||||
}
|
||||
|
||||
ti->class = g_malloc0(ti->class_size);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue