diff options
| author | Eduardo Habkost <ehabkost@redhat.com> | 2016-12-12 16:31:01 -0200 |
|---|---|---|
| committer | Paolo Bonzini <pbonzini@redhat.com> | 2017-01-16 17:52:34 +0100 |
| commit | 1c6d75d5f7c18ffc87e87d6c3ab6e55fb38fb076 (patch) | |
| tree | 4705e001812f5834487a58b0fdd7dac7bb9c9174 /qom/object.c | |
| parent | 765a707000e838c30b18d712fe6cb3dd8e0435f3 (diff) | |
| download | focaccia-qemu-1c6d75d5f7c18ffc87e87d6c3ab6e55fb38fb076.tar.gz focaccia-qemu-1c6d75d5f7c18ffc87e87d6c3ab6e55fb38fb076.zip | |
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>
Diffstat (limited to 'qom/object.c')
| -rw-r--r-- | qom/object.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/qom/object.c b/qom/object.c index 7a05e35ed9..760fafb0dc 100644 --- a/qom/object.c +++ b/qom/object.c @@ -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); |