[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 3/7] hmp: Restrict auto-complete in preconfig
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[Qemu-devel] [PATCH v3 3/7] hmp: Restrict auto-complete in preconfig |
Date: |
Fri, 8 Jun 2018 14:08:42 +0100 |
From: "Dr. David Alan Gilbert" <address@hidden>
Don't show the commands that aren't available.
Signed-off-by: Dr. David Alan Gilbert <address@hidden>
Reviewed-by: Peter Xu <address@hidden>
Reviewed-by: Igor Mammedov <address@hidden>
---
monitor.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/monitor.c b/monitor.c
index 31c8f5dc88..c369b392db 100644
--- a/monitor.c
+++ b/monitor.c
@@ -3951,12 +3951,17 @@ static void monitor_find_completion_by_table(Monitor
*mon,
cmdname = args[0];
readline_set_completion_index(mon->rs, strlen(cmdname));
for (cmd = cmd_table; cmd->name != NULL; cmd++) {
- cmd_completion(mon, cmdname, cmd->name);
+ if (!runstate_check(RUN_STATE_PRECONFIG) ||
+ cmd_can_preconfig(cmd)) {
+ cmd_completion(mon, cmdname, cmd->name);
+ }
}
} else {
/* find the command */
for (cmd = cmd_table; cmd->name != NULL; cmd++) {
- if (compare_cmd(args[0], cmd->name)) {
+ if (compare_cmd(args[0], cmd->name) &&
+ (!runstate_check(RUN_STATE_PRECONFIG) ||
+ cmd_can_preconfig(cmd))) {
break;
}
}
--
2.17.0
- Re: [Qemu-devel] [PATCH v3 4/7] qmp: enable query-[chardev|version|name|uuid|iothreads|memdev] commands in preconfig state, (continued)
[Qemu-devel] [PATCH v3 3/7] hmp: Restrict auto-complete in preconfig,
Dr. David Alan Gilbert (git) <=
[Qemu-devel] [PATCH v3 7/7] hmp: Allow HMP in preconfig state again, Dr. David Alan Gilbert (git), 2018/06/08
Re: [Qemu-devel] [PATCH v3 0/7] Reenable hmp for preconfig mode, Markus Armbruster, 2018/06/11