[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 20/25] qapi: Improve reporting of missing / unknown definitio
From: |
Eric Blake |
Subject: |
Re: [PATCH 20/25] qapi: Improve reporting of missing / unknown definition keys |
Date: |
Tue, 24 Sep 2019 13:13:12 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
On 9/24/19 8:28 AM, Markus Armbruster wrote:
> Have check_exprs() call check_keys() later, so its error messages gain
> an "in definition" line.
>
> Both check_keys() and check_name_is_str() check the definition's name
> is a string. Since check_keys() now runs after check_name_is_str()
> rather than before, its check is dead. Bury it. Checking values in
> check_keys() is unclean anyway.
>
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
> +++ b/scripts/qapi/common.py
> @@ -905,8 +905,6 @@ def check_known_keys(value, info, source, required,
> optional):
>
> def check_keys(expr, info, meta, required, optional=[]):
> name = expr[meta]
> - if not isinstance(name, str):
> - raise QAPISemError(info, "'%s' key must have a string value" % meta)
Should this be replaced with an assert? But I'm also okay just dropping
it, since our testsuite shows that we still flag the problems that this
message was originally used for.
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- [PATCH 18/25] qapi: Improve reporting of invalid 'if' errors, (continued)
- [PATCH 18/25] qapi: Improve reporting of invalid 'if' errors, Markus Armbruster, 2019/09/24
- [PATCH 12/25] qapi: Move check for reserved names out of add_name(), Markus Armbruster, 2019/09/24
- [PATCH 22/25] qapi: Eliminate check_keys(), rename check_known_keys(), Markus Armbruster, 2019/09/24
- [PATCH 19/25] qapi: Improve reporting of invalid flags, Markus Armbruster, 2019/09/24
- [PATCH 20/25] qapi: Improve reporting of missing / unknown definition keys, Markus Armbruster, 2019/09/24
- Re: [PATCH 20/25] qapi: Improve reporting of missing / unknown definition keys,
Eric Blake <=
- [PATCH 05/25] qapi: Clean up member name case checking, Markus Armbruster, 2019/09/24
- [PATCH 23/25] qapi: Improve reporting of missing documentation comment, Markus Armbruster, 2019/09/24
- [PATCH 09/25] qapi: Improve reporting of invalid name errors, Markus Armbruster, 2019/09/24
- [PATCH 25/25] qapi: Improve source file read error handling, Markus Armbruster, 2019/09/24