On Sat, Jul 23, 2022 at 01:36:13AM +0200, Ilya Leoshkevich wrote:
> 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 <[email protected]>
> ---
> +++ b/qapi/run-state.json
> @@ -364,10 +364,12 @@
> #
> # @shutdown: Shutdown the VM and exit, according to the shutdown action
> #
> +# @exit-failure: Shutdown the VM and exit with nonzero status
Missing a '(since 7.1)' tag. Otherwise a nice addition.
> +#
> # Since: 6.0
> ##
> { 'enum': 'PanicAction',
> - 'data': [ 'pause', 'shutdown', 'none' ] }
> + 'data': [ 'pause', 'shutdown', 'exit-failure', 'none' ] }
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org