qemu-e2k/scripts
Markus Armbruster c615550df3 qapi: Improve source file read error handling
qapi-gen.py crashes when it can't open the main schema file, and when
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 <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20190927134639.4284-27-armbru@redhat.com>
2019-09-28 17:17:48 +02:00
..
coccinelle qemu-iotests: convert `pwd` and $(pwd) to $PWD 2018-11-19 10:08:19 -06:00
kvm kvm: vmxcap: Enhance with latest features 2019-08-20 20:00:51 +02:00
modules Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
qapi qapi: Improve source file read error handling 2019-09-28 17:17:48 +02:00
qemu-guest-agent qemu-guest-agent: freeze-hook to ignore dpkg files as well 2018-08-23 18:46:25 +02:00
qemugdb scripts/qemugdb: re-license timers.py to GPLv2 or later 2019-03-12 08:04:22 +01:00
qmp qmp: make qmp-shell work with python3 2019-07-01 19:02:10 -03:00
tracetool trace: Forbid event format ending with newline character 2019-09-18 10:20:15 +01:00
travis travis: add gcovr summary for GCOV build 2018-07-05 15:59:41 +01:00
analyse-9p-simpletrace.py python: futurize -f libfuturize.fixes.fix_print_with_import 2018-06-08 14:39:24 -03:00
analyse-locks-simpletrace.py scripts: Remove unused python imports 2019-01-17 17:52:40 -02:00
analyze-inclusions Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
analyze-migration.py scripts: Remove unused python imports 2019-01-17 17:52:40 -02:00
archive-source.sh archive-source: also create a stash for submodules 2019-07-23 15:53:25 +01:00
checkpatch.pl docs: convert README, CODING_STYLE and HACKING to RST syntax 2019-09-05 14:27:06 +01:00
clean-header-guards.pl scripts/clean-header-guards: Fix handling of trailing comments 2019-06-12 13:20:20 +02:00
clean-includes scripts/clean-includes: added duplicate #include check 2016-10-28 18:17:23 +03:00
cleanup-trace-events.pl scripts/cleanup-trace-events: Update for current practice 2019-03-22 16:18:07 +00:00
cocci-macro-file.h QEMU_PACKED: Remove gcc_struct attribute in Windows non x86 targets 2019-05-07 12:55:02 +01:00
coverity-model.c coverity-model: Fix replay_get_byte() 2018-07-05 15:09:52 +02:00
create_config create_config: remove $(CONFIG_SOFTMMU) hack 2019-07-15 20:58:37 +02:00
decodetree.py decodetree: Suppress redundant declaration warnings 2019-08-19 08:13:14 -07:00
device-crash-test python/qemu: split QEMUMachine out from underneath __init__.py 2019-07-01 19:02:10 -03:00
disas-objdump.pl scripts: Switch to more portable Perl shebang 2017-05-10 10:19:24 +03:00
dump-guest-memory.py dump: Set correct vaddr for ELF dump 2019-02-06 15:51:12 +01:00
extract-vsssdk-headers Add a script to extract VSS SDK headers on POSIX system 2013-09-09 14:17:56 -05:00
feature_to_c.sh scripts: Use $(..) instead of deprecated `..` 2016-06-07 18:19:23 +03:00
fix-multiline-comments.sh scripts: add script to convert multiline comments into 4-line format 2019-01-11 15:46:55 +01:00
get_maintainer.pl get_maintainer: use 'https://' instead of 'git://' 2018-11-12 11:26:02 +00:00
git-submodule.sh git-submodule.sh: Modern shell scripting (use $() instead of ``) 2018-10-16 18:34:19 +02:00
git.orderfile scripts/git.orderfile: Match QAPI schema more precisely 2019-09-24 14:07:22 +02:00
hxtool qemu-options: Remove stray colons from output of --help 2017-12-20 09:04:27 +01:00
make-release scripts/make-release: Stop shipping u-boot source as a tarball 2019-03-18 15:40:00 +00:00
minikconf.py minikconf: don't print CONFIG_FOO=n lines 2019-08-21 16:29:57 +02:00
qapi-gen.py qapi: Lift error reporting from QAPISchema.__init__() to callers 2018-03-02 13:14:09 -06:00
qemu-binfmt-conf.sh qemu-binfmt-conf.sh: add x86_64 target 2018-08-17 13:56:33 +02:00
qemu-gdb.py qemugdb: fix licensing 2019-03-11 16:55:52 +01:00
qemu-trace-stap trace: add ability to do simple printf logging via systemtap 2019-01-24 14:16:56 +00:00
qemu-trace-stap.texi trace: add ability to do simple printf logging via systemtap 2019-01-24 14:16:56 +00:00
refresh-pxe-roms.sh roms: rewrite scripts/refresh-pxe-roms.sh 2013-09-30 09:44:35 +02:00
render_block_graph.py python/qemu: split QEMUMachine out from underneath __init__.py 2019-07-01 19:02:10 -03:00
replay-dump.py scripts/replay-dump.py: fix utf-8 mangling 2019-01-17 17:52:40 -02:00
shaderinclude.pl scripts: Switch to more portable Perl shebang 2017-05-10 10:19:24 +03:00
show-fixed-bugs.sh show-fixed-bugs.sh: Modern shell scripting (use $() instead of ``) 2018-10-16 18:34:19 +02:00
signrom.py python: futurize -f libfuturize.fixes.fix_print_with_import 2018-06-08 14:39:24 -03:00
simpletrace.py scripts: Remove unused python imports 2019-01-17 17:52:40 -02:00
switch-timer-api scripts: Switch to more portable Perl shebang 2017-05-10 10:19:24 +03:00
tap-driver.pl tap: flush STDOUT on newline 2019-02-05 16:50:16 +01:00
tap-merge.pl tap: flush STDOUT on newline 2019-02-05 16:50:16 +01:00
texi2pod.pl maint: Allow for EXAMPLES in texi2pod 2019-01-21 15:49:51 -06:00
tracetool.py scripts: Remove unused python imports 2019-01-17 17:52:40 -02:00
update-linux-headers.sh update-linux-headers: handle new header file 2019-05-21 16:56:30 +02:00
vmstate-static-checker.py python: futurize -f libfuturize.fixes.fix_next_call 2018-06-08 14:39:24 -03:00