From 5f9dba1600de5e6312ea2d86cff61a5f03c8207e Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Thu, 13 Jun 2019 17:33:54 +0200 Subject: monitor: Create MonitorHMP with readline state The ReadLineState in Monitor is only used for HMP monitors. Create MonitorHMP and move it there. Can't use container_of() in hmp_change(). Cast instead, and mark FIXME. Will be cleaned up shortly. Signed-off-by: Kevin Wolf Reviewed-by: Dr. David Alan Gilbert Message-Id: <20190613153405.24769-5-kwolf@redhat.com> Reviewed-by: Markus Armbruster [Superfluous variable in monitor_data_destroy() eliminated, whitespace tweaked in hmp_change(), commit message improved] Signed-off-by: Markus Armbruster --- include/monitor/monitor.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h index 1e1d6d2269..f9d30e1d78 100644 --- a/include/monitor/monitor.h +++ b/include/monitor/monitor.h @@ -6,6 +6,7 @@ #include "qemu/readline.h" extern __thread Monitor *cur_mon; +typedef struct MonitorHMP MonitorHMP; /* flags for monitor_init */ /* 0x01 unused */ @@ -34,8 +35,8 @@ void monitor_flush(Monitor *mon); int monitor_set_cpu(int cpu_index); int monitor_get_cpu_index(void); -void monitor_read_command(Monitor *mon, int show_prompt); -int monitor_read_password(Monitor *mon, ReadLineFunc *readline_func, +void monitor_read_command(MonitorHMP *mon, int show_prompt); +int monitor_read_password(MonitorHMP *mon, ReadLineFunc *readline_func, void *opaque); AddfdInfo *monitor_fdset_add_fd(int fd, bool has_fdset_id, int64_t fdset_id, -- cgit v1.2.3-55-g7522