From: Markus Armbruster Date: Sat, 14 Sep 2019 15:35:04 +0000 (+0200) Subject: qapi: Fix to .check() empty structs just once X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b1bc31f4b7db07ca7b76de604bef4088be0c18b7;p=qemu.git qapi: Fix to .check() empty structs just once QAPISchemaObjectType.check() does nothing for types that have been checked already. Except the "has been checked" predicate is broken for empty types: self.members is [] then, which isn't true. The bug is harmless, but fix it anyway: use self.member is not None instead. Signed-off-by: Markus Armbruster Message-Id: <20190914153506.2151-18-armbru@redhat.com> Reviewed-by: Eric Blake --- diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py index 7e79c42b6a..e2c87d1349 100644 --- a/scripts/qapi/common.py +++ b/scripts/qapi/common.py @@ -1406,7 +1406,7 @@ class QAPISchemaObjectType(QAPISchemaType): if self.members is False: # check for cycles raise QAPISemError(self.info, "Object %s contains itself" % self.name) - if self.members: + if self.members is not None: # already checked return self.members = False # mark as being checked seen = OrderedDict()