From 84c44613f9ad8d13e0d2dbee767051527072dc12 Mon Sep 17 00:00:00 2001 From: Wenchao Xia Date: Mon, 14 Jan 2013 14:06:29 +0800 Subject: HMP: add sub command table to info Now info command takes a table of sub info commands, and changed do_info() to do_info_help() to do help funtion only. Note that now "info " returns error instead of list of info topics. Signed-off-by: Wenchao Xia Signed-off-by: Luiz Capitulino --- monitor.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'monitor.c') diff --git a/monitor.c b/monitor.c index ef1b7ac..20bd19b 100644 --- a/monitor.c +++ b/monitor.c @@ -811,28 +811,8 @@ static void user_async_cmd_handler(Monitor *mon, const mon_cmd_t *cmd, } } -static void do_info(Monitor *mon, const QDict *qdict) +static void do_info_help(Monitor *mon, const QDict *qdict) { - const mon_cmd_t *cmd; - const char *item = qdict_get_try_str(qdict, "item"); - - if (!item) { - goto help; - } - - for (cmd = info_cmds; cmd->name != NULL; cmd++) { - if (compare_cmd(item, cmd->name)) - break; - } - - if (cmd->name == NULL) { - goto help; - } - - cmd->mhandler.cmd(mon, NULL); - return; - -help: help_cmd(mon, "info"); } -- cgit v1.1