From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Cc: marcandre.lureau@redhat.com, mdroth@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH 17/19] qapi: Fix to .check() empty structs just once
Date: Tue, 17 Sep 2019 14:06:16 -0500 [thread overview]
Message-ID: <c427423a-7a32-8ed5-8f67-9131d6166e5c@redhat.com> (raw)
In-Reply-To: <20190914153506.2151-18-armbru@redhat.com>
[-- Attachment #1.1: Type: text/plain, Size: 1332 bytes --]
On 9/14/19 10:35 AM, Markus Armbruster wrote:
> 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 <armbru@redhat.com>
> ---
> scripts/qapi/common.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Eric Blake <eblake@redhat.com>
>
> 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()
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2019-09-17 20:52 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-14 15:34 [Qemu-devel] [PATCH 00/19] qapi: Frontend fixes and cleanups Markus Armbruster
2019-09-14 15:34 ` [Qemu-devel] [PATCH 01/19] tests/qapi-schema: Cover unknown pragma Markus Armbruster
2019-09-17 16:36 ` Eric Blake
2019-09-14 15:34 ` [Qemu-devel] [PATCH 02/19] tests/qapi-schema: Delete two redundant tests Markus Armbruster
2019-09-17 16:57 ` Eric Blake
2019-09-14 15:34 ` [Qemu-devel] [PATCH 03/19] tests/qapi-schema: Demonstrate misleading optional tag error Markus Armbruster
2019-09-17 17:36 ` Eric Blake
2019-09-14 15:34 ` [Qemu-devel] [PATCH 04/19] tests/qapi-schema: Demonstrate broken discriminator errors Markus Armbruster
2019-09-17 17:43 ` Eric Blake
2019-09-14 15:34 ` [Qemu-devel] [PATCH 05/19] tests/qapi-schema: Demonstrate insufficient 'if' checking Markus Armbruster
2019-09-17 17:47 ` Eric Blake
2019-09-23 11:55 ` Markus Armbruster
2019-09-23 12:55 ` Eric Blake
2019-09-14 15:34 ` [Qemu-devel] [PATCH 06/19] tests/qapi-schema: Demonstrate suboptimal lexical errors Markus Armbruster
2019-09-17 17:49 ` Eric Blake
2019-09-14 15:34 ` [Qemu-devel] [PATCH 07/19] qapi: Use quotes more consistently in frontend error messages Markus Armbruster
2019-09-17 17:52 ` Eric Blake
2019-09-14 15:34 ` [Qemu-devel] [PATCH 08/19] qapi: Improve reporting of lexical errors Markus Armbruster
2019-09-17 17:54 ` Eric Blake
2019-09-14 15:34 ` [Qemu-devel] [PATCH 09/19] qapi: Remove null from schema language Markus Armbruster
2019-09-17 18:01 ` Eric Blake
2019-09-14 15:34 ` [Qemu-devel] [PATCH 10/19] qapi: Fix broken discriminator error messages Markus Armbruster
2019-09-17 18:05 ` Eric Blake
2019-09-14 15:34 ` [Qemu-devel] [PATCH 11/19] qapi: Reject blank 'if' conditions in addition to empty ones Markus Armbruster
2019-09-17 18:06 ` Eric Blake
2019-09-14 15:34 ` [Qemu-devel] [PATCH 12/19] qapi: Fix missing 'if' checks in struct, union, alternate 'data' Markus Armbruster
2019-09-17 18:10 ` Eric Blake
2019-09-14 15:35 ` [Qemu-devel] [PATCH 13/19] qapi: Normalize 'if' in check_exprs(), like other sugar Markus Armbruster
2019-09-17 18:14 ` Eric Blake
2019-09-23 11:59 ` Markus Armbruster
2019-09-14 15:35 ` [Qemu-devel] [PATCH 14/19] qapi: Simplify check_keys() Markus Armbruster
2019-09-17 19:01 ` Eric Blake
2019-09-14 15:35 ` [Qemu-devel] [PATCH 15/19] qapi: Clean up around check_known_keys() Markus Armbruster
2019-09-17 19:03 ` Eric Blake
2019-09-14 15:35 ` [Qemu-devel] [PATCH 16/19] qapi: Delete useless check_exprs() code for simple union kind Markus Armbruster
2019-09-17 19:05 ` Eric Blake
2019-09-14 15:35 ` [Qemu-devel] [PATCH 17/19] qapi: Fix to .check() empty structs just once Markus Armbruster
2019-09-17 19:06 ` Eric Blake [this message]
2019-09-14 15:35 ` [Qemu-devel] [PATCH 18/19] qapi: Fix excessive QAPISchemaEntity.check() recursion Markus Armbruster
2019-09-17 19:26 ` Eric Blake
2019-09-23 12:01 ` Markus Armbruster
2019-09-14 15:35 ` [Qemu-devel] [PATCH 19/19] qapi: Assert .visit() and .check_clash() run only after .check() Markus Armbruster
2019-09-17 19:27 ` Eric Blake
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c427423a-7a32-8ed5-8f67-9131d6166e5c@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).