diff options
author | Ilya Leoshkevich <iii@linux.ibm.com> | 2022-07-26 00:37:45 +0200 |
---|---|---|
committer | Alex Bennée <alex.bennee@linaro.org> | 2022-07-29 09:48:01 +0100 |
commit | 0882caf4d607bcfb1efa99034f5f045f30eb43d7 (patch) | |
tree | cddc59ef1f87b6d6c6346423dddd81a02966d119 /softmmu/main.c | |
parent | 9b1268f55ceb0d9390a051cad299b3021dfa9896 (diff) |
qapi: Add exit-failure PanicAction
Currently QEMU exits with code 0 on both panic an shutdown. For tests
it is useful to return 1 on panic, so that it counts as a test
failure.
Introduce a new exit-failure PanicAction that makes main() return
EXIT_FAILURE. Tests can use -action panic=exit-failure option to
activate this behavior.
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Message-Id: <20220725223746.227063-2-iii@linux.ibm.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Diffstat (limited to 'softmmu/main.c')
-rw-r--r-- | softmmu/main.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/softmmu/main.c b/softmmu/main.c index c00432ff09..1b675a8c03 100644 --- a/softmmu/main.c +++ b/softmmu/main.c @@ -32,11 +32,13 @@ int qemu_main(int argc, char **argv, char **envp) { + int status; + qemu_init(argc, argv, envp); - qemu_main_loop(); + status = qemu_main_loop(); qemu_cleanup(); - return 0; + return status; } #ifndef CONFIG_COCOA |