From 1c6d75d5f7c18ffc87e87d6c3ab6e55fb38fb076 Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Mon, 12 Dec 2016 16:31:01 -0200 Subject: 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 Message-Id: <1481567461-2341-1-git-send-email-ehabkost@redhat.com> Signed-off-by: Paolo Bonzini --- qom/object.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'qom/object.c') diff --git a/qom/object.c b/qom/object.c index 7a05e35..760fafb 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); -- cgit v1.1