summaryrefslogtreecommitdiff
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-19 08:26:21 -0600
commit602e97b725302c5dbd6448abf08958e5a7cc5533 (patch)
tree012ab0da46b54df189da341b90f228f20953473f
parent97b766dfcdca6e5d0ac7c48f4a9435d95c2ed8be (diff)
downloadqemu-602e97b725302c5dbd6448abf08958e5a7cc5533.tar.gz
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> (cherry picked from commit 183e6e525764d5c4978e37b42dc2cde0b0ffcfec)
-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);