monitor: Split out monitor/monitor.c

Move the monitor core infrastructure from monitor/misc.c to
monitor/monitor.c. This is code that can be shared for all targets, so
compile it only once.

What remains in monitor/misc.c after this patch is mostly monitor
command implementations (which could move to hmp-cmds.c or qmp-cmds.c
later) and code that requires a system emulator or is even
target-dependent (including HMP command completion code).

The amount of function and particularly extern variables in
monitor_int.h is probably a bit larger than it needs to be, but this way
no non-trivial code modifications are needed. The interfaces between all
monitor parts can be cleaned up later.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20190613153405.24769-13-kwolf@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Superfluous #include dropped]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
Kevin Wolf
2019-06-18 08:14:17 +02:00
committed by Markus Armbruster
parent ed7bda5d07
commit 1d95db745b
7 changed files with 640 additions and 599 deletions
+2
View File
@@ -1920,6 +1920,7 @@ M: Dr. David Alan Gilbert <dgilbert@redhat.com>
S: Maintained
F: monitor/monitor-internal.h
F: monitor/misc.c
F: monitor/monitor.c
F: monitor/hmp*
F: hmp.h
F: hmp-commands*.hx
@@ -2044,6 +2045,7 @@ S: Supported
F: monitor/monitor-internal.h
F: monitor/qmp*
F: monitor/misc.c
F: monitor/monitor.c
F: docs/devel/*qmp-*
F: docs/interop/*qmp-*
F: scripts/qmp/
+1
View File
@@ -19,6 +19,7 @@ typedef struct MonitorHMP MonitorHMP;
bool monitor_cur_is_qmp(void);
void monitor_init_globals(void);
void monitor_init_globals_core(void);
void monitor_init(Chardev *chr, int flags);
void monitor_cleanup(void);
+1 -1
View File
@@ -1,3 +1,3 @@
obj-y += misc.o
common-obj-y += qmp.o hmp.o
common-obj-y += monitor.o qmp.o hmp.o
common-obj-y += qmp-cmds.o hmp-cmds.o
+1 -597
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -167,6 +167,7 @@ void monitor_init_hmp(Chardev *chr, int flags);
int monitor_puts(Monitor *mon, const char *str);
void monitor_data_init(Monitor *mon, int flags, bool skip_flush,
bool use_io_thread);
void monitor_data_destroy(Monitor *mon);
int monitor_can_read(void *opaque);
void monitor_list_append(Monitor *mon);
void monitor_fdsets_cleanup(void);
+633
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -3,7 +3,7 @@
# hmp.c
handle_hmp_command(void *mon, const char *cmdline) "mon %p cmdline: %s"
# misc.c
# monitor.c
monitor_protocol_event_handler(uint32_t event, void *qdict) "event=%d data=%p"
monitor_protocol_event_emit(uint32_t event, void *data) "event=%d data=%p"
monitor_protocol_event_queue(uint32_t event, void *qdict, uint64_t rate) "event=%d data=%p rate=%" PRId64