aboutsummaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-09-02 12:34:50 -0500
committerLuiz Capitulino <lcapitulino@redhat.com>2012-01-18 10:23:39 -0200
commit7060b478d3f3a8bc7a282292609ff5aec6de1958 (patch)
tree6ef554944e1c4992a563987d53e516fcda730b1d /monitor.c
parentc245b6a37d76670c3ba7b9063bac943bb998bb7c (diff)
downloadqemu-7060b478d3f3a8bc7a282292609ff5aec6de1958.zip
qemu-7060b478d3f3a8bc7a282292609ff5aec6de1958.tar.gz
qemu-7060b478d3f3a8bc7a282292609ff5aec6de1958.tar.bz2
monitor: expose readline state
HMP is now implemented in terms of QMP. The monitor has a bunch of logic to deal with HMP right now like readline support. Export it from the monitor so we can consume it in hmp.c. In short time, hmp.c will take over all of the readline bits. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/monitor.c b/monitor.c
index aa7259c..bd4bc4f 100644
--- a/monitor.c
+++ b/monitor.c
@@ -227,7 +227,7 @@ int monitor_cur_is_qmp(void)
return cur_mon && monitor_ctrl_mode(cur_mon);
}
-static void monitor_read_command(Monitor *mon, int show_prompt)
+void monitor_read_command(Monitor *mon, int show_prompt)
{
if (!mon->rs)
return;
@@ -237,8 +237,8 @@ static void monitor_read_command(Monitor *mon, int show_prompt)
readline_show_prompt(mon->rs);
}
-static int monitor_read_password(Monitor *mon, ReadLineFunc *readline_func,
- void *opaque)
+int monitor_read_password(Monitor *mon, ReadLineFunc *readline_func,
+ void *opaque)
{
if (monitor_ctrl_mode(mon)) {
qerror_report(QERR_MISSING_PARAMETER, "password");
@@ -4664,6 +4664,11 @@ static void bdrv_password_cb(Monitor *mon, const char *password, void *opaque)
monitor_read_command(mon, 1);
}
+ReadLineState *monitor_get_rs(Monitor *mon)
+{
+ return mon->rs;
+}
+
int monitor_read_bdrv_key_start(Monitor *mon, BlockDriverState *bs,
BlockDriverCompletionFunc *completion_cb,
void *opaque)