提交 7a7f325e 编写于 作者: L Luiz Capitulino

qapi: Convert quit

Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
上级 aa9b79bc
...@@ -43,7 +43,7 @@ ETEXI ...@@ -43,7 +43,7 @@ ETEXI
.params = "", .params = "",
.help = "quit the emulator", .help = "quit the emulator",
.user_print = monitor_user_noop, .user_print = monitor_user_noop,
.mhandler.cmd_new = do_quit, .mhandler.cmd = hmp_quit,
}, },
STEXI STEXI
......
...@@ -93,3 +93,9 @@ void hmp_info_chardev(Monitor *mon) ...@@ -93,3 +93,9 @@ void hmp_info_chardev(Monitor *mon)
qapi_free_ChardevInfoList(char_info); qapi_free_ChardevInfoList(char_info);
} }
void hmp_quit(Monitor *mon, const QDict *qdict)
{
monitor_suspend(mon);
qmp_quit(NULL);
}
...@@ -23,5 +23,6 @@ void hmp_info_kvm(Monitor *mon); ...@@ -23,5 +23,6 @@ void hmp_info_kvm(Monitor *mon);
void hmp_info_status(Monitor *mon); void hmp_info_status(Monitor *mon);
void hmp_info_uuid(Monitor *mon); void hmp_info_uuid(Monitor *mon);
void hmp_info_chardev(Monitor *mon); void hmp_info_chardev(Monitor *mon);
void hmp_quit(Monitor *mon, const QDict *qdict);
#endif #endif
...@@ -946,18 +946,6 @@ static void do_trace_print_events(Monitor *mon) ...@@ -946,18 +946,6 @@ static void do_trace_print_events(Monitor *mon)
trace_print_events((FILE *)mon, &monitor_fprintf); trace_print_events((FILE *)mon, &monitor_fprintf);
} }
/**
* do_quit(): Quit QEMU execution
*/
static int do_quit(Monitor *mon, const QDict *qdict, QObject **ret_data)
{
monitor_suspend(mon);
no_shutdown = 0;
qemu_system_shutdown_request();
return 0;
}
#ifdef CONFIG_VNC #ifdef CONFIG_VNC
static int change_vnc_password(const char *password) static int change_vnc_password(const char *password)
{ {
......
...@@ -225,3 +225,14 @@ ...@@ -225,3 +225,14 @@
## ##
{ 'command': 'query-commands', 'returns': ['CommandInfo'] } { 'command': 'query-commands', 'returns': ['CommandInfo'] }
##
# @quit:
#
# This command will cause the QEMU process to exit gracefully. While every
# attempt is made to send the QMP response before terminating, this is not
# guaranteed. When using this interface, a premature EOF would not be
# unexpected.
#
# Since: 0.14.0
##
{ 'command': 'quit' }
...@@ -63,10 +63,7 @@ EQMP ...@@ -63,10 +63,7 @@ EQMP
{ {
.name = "quit", .name = "quit",
.args_type = "", .args_type = "",
.params = "", .mhandler.cmd_new = qmp_marshal_input_quit,
.help = "quit the emulator",
.user_print = monitor_user_noop,
.mhandler.cmd_new = do_quit,
}, },
SQMP SQMP
......
...@@ -70,3 +70,9 @@ UuidInfo *qmp_query_uuid(Error **errp) ...@@ -70,3 +70,9 @@ UuidInfo *qmp_query_uuid(Error **errp)
return info; return info;
} }
void qmp_quit(Error **err)
{
no_shutdown = 0;
qemu_system_shutdown_request();
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册