]> git.proxmox.com Git - mirror_qemu.git/commitdiff
monitor: don't try to initialize json parser when monitor is HMP
authorAnthony Liguori <aliguori@us.ibm.com>
Thu, 23 Aug 2012 18:49:02 +0000 (13:49 -0500)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 24 Aug 2012 01:19:59 +0000 (20:19 -0500)
Reported-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
monitor.c

index b18858205759eecaa50fb2e3721cbd9fc26db117..b17b1bb84971042709e455f380ed6e62408cbe7e 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -4946,13 +4946,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;