From 183e6e525764d5c4978e37b42dc2cde0b0ffcfec Mon Sep 17 00:00:00 2001 From: Luiz Capitulino Date: Mon, 14 Dec 2009 18:53:23 -0200 Subject: [PATCH] monitor: Avoid readline functions in QMP The monitor_read_command() function is readline specific and should only be used when readline is available. Signed-off-by: Luiz Capitulino Signed-off-by: Anthony Liguori --- monitor.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/monitor.c b/monitor.c index 920ccff584..b518cc4b55 100644 --- a/monitor.c +++ b/monitor.c @@ -140,6 +140,9 @@ static inline int monitor_ctrl_mode(const Monitor *mon) static void monitor_read_command(Monitor *mon, int show_prompt) { + if (!mon->rs) + return; + readline_start(mon->rs, "(qemu) ", 0, monitor_command_cb, NULL); if (show_prompt) readline_show_prompt(mon->rs);