Commit 39b59d26 authored by Luiz Capitulino's avatar Luiz Capitulino

Monitor: Return before exiting with 'quit'

This is a new version of the (now reverted) following commit:


The 'quit' Monitor command (implemented by do_quit()) calls
exit() directly, this is problematic under QMP because QEMU
exits before having a chance to send the ok response.

Clients don't know if QEMU exited because of a problem or
because the 'quit' command has been executed.

This commit fixes that by making do_quit() use
qemu_system_shutdown_request(), so that we exit gracefully.

Thanks to Paolo Bonzini <> for suggesting
this solution.
Signed-off-by: default avatarLuiz Capitulino <>
parent a691d41a
......@@ -1020,7 +1020,10 @@ static void do_info_cpu_stats(Monitor *mon)
static int do_quit(Monitor *mon, const QDict *qdict, QObject **ret_data)
no_shutdown = 0;
return 0;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment