[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 25/25] qapi: Improve source file read error handling
From: |
Markus Armbruster |
Subject: |
Re: [PATCH 25/25] qapi: Improve source file read error handling |
Date: |
Tue, 24 Sep 2019 22:59:32 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) |
Eric Blake <address@hidden> writes:
> 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
Will fix.
>> 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>
Thanks!
- Re: [PATCH 20/25] qapi: Improve reporting of missing / unknown definition keys, (continued)
- [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
- [PATCH 08/25] qapi: Reorder check_FOO() parameters for consistency, Markus Armbruster, 2019/09/24
- [PATCH 14/25] qapi: Plumb info to the QAPISchemaMember, Markus Armbruster, 2019/09/24
- [PATCH 04/25] qapi: Prefix frontend errors with an "in definition" line, Markus Armbruster, 2019/09/24
- [PATCH 21/25] qapi: Avoid redundant definition references in error messages, Markus Armbruster, 2019/09/24
- [PATCH 06/25] qapi: Change frontend error messages to start with lower case, Markus Armbruster, 2019/09/24