Browse Source
While there are a number of uses in the code-base of the exit(0) pattern it gets in the way of clean exit which can do all of it's house-keeping. In particular it was reported that you can crash plugins this way because TCG can still be running on other threads when the atexit callback is called. Use qmp_quit() instead which takes care of some housekeeping before triggering the shutdown. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reported-by: Lukas Jünger <lukas.junger@greensocs.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20211026102234.3961636-19-alex.bennee@linaro.org>pull/200/head
3 changed files with 11 additions and 1 deletions
@ -0,0 +1,8 @@ |
|||
#include "qemu/osdep.h" |
|||
#include "qapi/qapi-commands-control.h" |
|||
#include "qapi/qmp/dispatch.h" |
|||
|
|||
void qmp_quit(Error **errp) |
|||
{ |
|||
g_assert_not_reached(); |
|||
} |
|||
Loading…
Reference in new issue