diff options
author | Luiz Capitulino <lcapitulino@redhat.com> | 2010-02-10 23:50:00 -0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-02-19 15:18:17 -0600 |
commit | 4fdc94b4062cb51c000c718bbffea3ac8c242b51 (patch) | |
tree | dbb035127cb189619336b7d83cabaad4e78d0734 /monitor.c | |
parent | fe38a32acc6d1fb62ed74c351c1cc1d992aa8c50 (diff) | |
download | qemu-4fdc94b4062cb51c000c718bbffea3ac8c242b51.zip qemu-4fdc94b4062cb51c000c718bbffea3ac8c242b51.tar.gz qemu-4fdc94b4062cb51c000c718bbffea3ac8c242b51.tar.bz2 |
Monitor: Convert do_info() to cmd_new_ret()
Note that this function only fails in QMP, in the user Monitor
it prints the help text instead.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'monitor.c')
-rw-r--r-- | monitor.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -556,7 +556,7 @@ static void user_async_info_handler(Monitor *mon, const mon_cmd_t *cmd) } } -static void do_info(Monitor *mon, const QDict *qdict, QObject **ret_data) +static int do_info(Monitor *mon, const QDict *qdict, QObject **ret_data) { const mon_cmd_t *cmd; const char *item = qdict_get_try_str(qdict, "item"); @@ -574,7 +574,7 @@ static void do_info(Monitor *mon, const QDict *qdict, QObject **ret_data) if (cmd->name == NULL) { if (monitor_ctrl_mode(mon)) { qemu_error_new(QERR_COMMAND_NOT_FOUND, item); - return; + return -1; } goto help; } @@ -606,15 +606,17 @@ static void do_info(Monitor *mon, const QDict *qdict, QObject **ret_data) if (monitor_ctrl_mode(mon)) { /* handler not converted yet */ qemu_error_new(QERR_COMMAND_NOT_FOUND, item); + return -1; } else { cmd->mhandler.info(mon); } } - return; + return 0; help: help_cmd(mon, "info"); + return 0; } static void do_info_version_print(Monitor *mon, const QObject *data) |