qemu-devel
[Top][All Lists]
Advanced

[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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]