From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c2Mac-0002Lf-Gt for qemu-devel@nongnu.org; Thu, 03 Nov 2016 14:18:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c2Maa-0008G0-OC for qemu-devel@nongnu.org; Thu, 03 Nov 2016 14:18:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53410) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c2Maa-0008Fi-Ig for qemu-devel@nongnu.org; Thu, 03 Nov 2016 14:18:12 -0400 From: Markus Armbruster References: <20161020112829.14589-1-lma@suse.com> <20161020112829.14589-2-lma@suse.com> Date: Thu, 03 Nov 2016 19:18:08 +0100 In-Reply-To: <20161020112829.14589-2-lma@suse.com> (Lin Ma's message of "Thu, 20 Oct 2016 19:28:25 +0800") Message-ID: <87bmxwwhpb.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v4 1/5] qom: Add interface check in object_class_is_abstract List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Lin Ma Cc: qemu-devel@nongnu.org, pbonzini@redhat.com, afaerber@suse.de Lin Ma writes: > Signed-off-by: Lin Ma > --- > qom/object.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/qom/object.c b/qom/object.c > index 7a05e35..4096645 100644 > --- a/qom/object.c > +++ b/qom/object.c > @@ -747,7 +747,11 @@ ObjectClass *object_get_class(Object *obj) > > bool object_class_is_abstract(ObjectClass *klass) > { > - return klass->type->abstract; > + if (type_is_ancestor(klass->type, type_interface)) { > + return true; > + } else { > + return klass->type->abstract; > + } > } > > const char *object_class_get_name(ObjectClass *klass) Pardon my ignorance... If all types derived from type_interface are abstract, why aren't we setting ->abstract right when such a type is defined? Hmm, perhaps we do? type_initialize_interface() sets info.abstract = true... In case we don't: what about other uses of ->abstract? Why is it okay not to check whether type_interface is an ancestore there?