aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-08-23 13:49:02 -0500
committerMichael Roth <mdroth@linux.vnet.ibm.com>2012-08-28 01:50:02 -0500
commit5330a894ed44e18ba8eb038fbc1060eac34ad8bc (patch)
tree10e7af5c21ae16bfbaf0eb65793b49e863300576
parentcdcf2aa41c816482b53e2d3909557c7c3f909845 (diff)
monitor: don't try to initialize json parser when monitor is HMP
Reported-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 26efaca377e004b79ff50a6e936d029a0c095b8b) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r--monitor.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/monitor.c b/monitor.c
index ab65a9aab..a7af002ed 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4605,13 +4605,13 @@ void monitor_init(CharDriverState *chr, int flags)
qemu_chr_add_handlers(chr, monitor_can_read, monitor_control_read,
monitor_control_event, mon);
qemu_chr_fe_set_echo(chr, true);
+
+ json_message_parser_init(&mon->mc->parser, handle_qmp_command);
} else {
qemu_chr_add_handlers(chr, monitor_can_read, monitor_read,
monitor_event, mon);
}
- json_message_parser_init(&mon->mc->parser, handle_qmp_command);
-
QLIST_INSERT_HEAD(&mon_list, mon, entry);
if (!default_mon || (flags & MONITOR_IS_DEFAULT))
default_mon = mon;