diff options
author | Luiz Capitulino <lcapitulino@redhat.com> | 2011-09-15 14:20:28 -0300 |
---|---|---|
committer | Luiz Capitulino <lcapitulino@redhat.com> | 2011-10-04 11:02:57 -0300 |
commit | 7a7f325e053c5079ce4b7b8e9e2b0f4c4c30ade8 (patch) | |
tree | dcdb119186cc081a65485edbe9826ca9f44aa6b1 | |
parent | aa9b79bcd813b399ad13e13b5db4e8b2e8787e4c (diff) |
qapi: Convert quit
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
-rw-r--r-- | hmp-commands.hx | 2 | ||||
-rw-r--r-- | hmp.c | 6 | ||||
-rw-r--r-- | hmp.h | 1 | ||||
-rw-r--r-- | monitor.c | 12 | ||||
-rw-r--r-- | qapi-schema.json | 11 | ||||
-rw-r--r-- | qmp-commands.hx | 5 | ||||
-rw-r--r-- | qmp.c | 6 |
7 files changed, 26 insertions, 17 deletions
diff --git a/hmp-commands.hx b/hmp-commands.hx index 9e1cca8e3d..2163e6f5f4 100644 --- a/hmp-commands.hx +++ b/hmp-commands.hx @@ -43,7 +43,7 @@ ETEXI .params = "", .help = "quit the emulator", .user_print = monitor_user_noop, - .mhandler.cmd_new = do_quit, + .mhandler.cmd = hmp_quit, }, STEXI @@ -93,3 +93,9 @@ void hmp_info_chardev(Monitor *mon) 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); void hmp_info_status(Monitor *mon); void hmp_info_uuid(Monitor *mon); void hmp_info_chardev(Monitor *mon); +void hmp_quit(Monitor *mon, const QDict *qdict); #endif @@ -946,18 +946,6 @@ static void do_trace_print_events(Monitor *mon) 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 static int change_vnc_password(const char *password) { diff --git a/qapi-schema.json b/qapi-schema.json index 35434c1eb6..38104635c0 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -225,3 +225,14 @@ ## { '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' } diff --git a/qmp-commands.hx b/qmp-commands.hx index 0fda5c3b97..151a5fa651 100644 --- a/qmp-commands.hx +++ b/qmp-commands.hx @@ -63,10 +63,7 @@ EQMP { .name = "quit", .args_type = "", - .params = "", - .help = "quit the emulator", - .user_print = monitor_user_noop, - .mhandler.cmd_new = do_quit, + .mhandler.cmd_new = qmp_marshal_input_quit, }, SQMP @@ -70,3 +70,9 @@ UuidInfo *qmp_query_uuid(Error **errp) return info; } +void qmp_quit(Error **err) +{ + no_shutdown = 0; + qemu_system_shutdown_request(); +} + |