qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 25/25] qapi: Improve source file read error handling


From: Eric Blake
Subject: Re: [PATCH 25/25] qapi: Improve source file read error handling
Date: Tue, 24 Sep 2019 14:57:09 -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:
> qap-gen.py crashes when it can't open the main schema file, and when

qapi-gen.py

> it can't read from any schema file.  Lazy.
> 
> Change QAPISchema.__init__() to take a file name instead of a file
> object.  Move the open code from _include() to __init__(), so it's
> used for the main schema file, too.
> 
> Move the read into the try for good measure, and rephrase the error
> message.
> 
> Reporting open or read failure for the main schema file needs a
> QAPISourceInfo representing "no source".  Make QAPISourceInfo cope
> with fname=None.
> 
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
>  scripts/qapi/common.py                | 46 +++++++++++++++------------
>  tests/qapi-schema/include-no-file.err |  2 +-
>  2 files changed, 27 insertions(+), 21 deletions(-)
> 

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]