aboutsummaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2009-12-14 18:53:23 -0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-12-18 11:26:27 -0600
commit183e6e525764d5c4978e37b42dc2cde0b0ffcfec (patch)
treee236f0eb4dc22f1b326bdd3204c4ab6e3dc44b06 /monitor.c
parentcfdf2c40577ed99bb19cdc05d0537e2808d77a78 (diff)
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 <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c3
1 files changed, 3 insertions, 0 deletions
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);