aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Mammedov <imammedo@redhat.com>2018-05-04 10:37:42 +0200
committerEduardo Habkost <ehabkost@redhat.com>2018-05-30 13:16:51 -0300
commit71dc578e116599ea73c8a2a4e693134702ec0e83 (patch)
tree6f52623d5878c90fd6c91182bb43099c9080273a
parent8a36283e120ab3633557d6732fa700366e0137c7 (diff)
hmp: disable monitor in preconfig state
Ban it for now, if someone would need it to work early, one would have to implement checks if HMP command is valid at preconfig state. Signed-off-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1525423069-61903-5-git-send-email-imammedo@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
-rw-r--r--monitor.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/monitor.c b/monitor.c
index 46814af533..9e50418afe 100644
--- a/monitor.c
+++ b/monitor.c
@@ -3371,6 +3371,12 @@ static void handle_hmp_command(Monitor *mon, const char *cmdline)
trace_handle_hmp_command(mon, cmdline);
+ if (runstate_check(RUN_STATE_PRECONFIG)) {
+ monitor_printf(mon, "HMP not available in preconfig state, "
+ "use QMP instead\n");
+ return;
+ }
+
cmd = monitor_parse_command(mon, cmdline, &cmdline, mon->cmd_table);
if (!cmd) {
return;