summary refs log tree commit diff stats
path: root/include/monitor/monitor.h
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2019-06-13 17:33:54 +0200
committerMarkus Armbruster <armbru@redhat.com>2019-06-17 20:36:56 +0200
commit5f9dba1600de5e6312ea2d86cff61a5f03c8207e (patch)
treed2267c43bbddf9451d41bdabe96b0e90b3420e30 /include/monitor/monitor.h
parentb8e31d6ccc40de09392766fc8a77133196ba8468 (diff)
downloadfocaccia-qemu-5f9dba1600de5e6312ea2d86cff61a5f03c8207e.tar.gz
focaccia-qemu-5f9dba1600de5e6312ea2d86cff61a5f03c8207e.zip
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 <kwolf@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20190613153405.24769-5-kwolf@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Superfluous variable in monitor_data_destroy() eliminated, whitespace
tweaked in hmp_change(), commit message improved]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'include/monitor/monitor.h')
-rw-r--r--include/monitor/monitor.h5
1 files changed, 3 insertions, 2 deletions
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,