diff mbox series

[PULL,05/12] hmp: disable monitor in preconfig state

Message ID 20180530230528.30166-6-ehabkost@redhat.com
State New
Headers show
Series [PULL,01/12] numa: clarify error message when node index is out of range in -numa dist, ... | expand

Commit Message

Eduardo Habkost May 30, 2018, 11:05 p.m. UTC
From: Igor Mammedov <imammedo@redhat.com>

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>
---
 monitor.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

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;