summaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorWenchao Xia <xiawenc@linux.vnet.ibm.com>2013-01-14 14:06:29 +0800
committerLuiz Capitulino <lcapitulino@redhat.com>2013-01-17 10:24:52 -0200
commit84c44613f9ad8d13e0d2dbee767051527072dc12 (patch)
treedc5b06bbad12ca0d71837152302842380c75a886 /monitor.c
parenta13ced59a4f305e37bd89f27f2b18f915889cad1 (diff)
downloadqemu-84c44613f9ad8d13e0d2dbee767051527072dc12.tar.gz
qemu-84c44613f9ad8d13e0d2dbee767051527072dc12.tar.bz2
qemu-84c44613f9ad8d13e0d2dbee767051527072dc12.zip
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 <unknown-topic>" returns error instead of list of info topics. Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/monitor.c b/monitor.c
index ef1b7ac062..20bd19b05f 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");
}