diff options
author | Kevin Wolf | 2019-06-13 17:33:53 +0200 |
---|---|---|
committer | Markus Armbruster | 2019-06-17 20:36:56 +0200 |
commit | b8e31d6ccc40de09392766fc8a77133196ba8468 (patch) | |
tree | 4b8308888a317eb716efc94cb9b41e502f208601 /include/monitor/monitor.h | |
parent | monitor: Split monitor_init in HMP and QMP function (diff) | |
download | qemu-b8e31d6ccc40de09392766fc8a77133196ba8468.tar.gz qemu-b8e31d6ccc40de09392766fc8a77133196ba8468.tar.xz qemu-b8e31d6ccc40de09392766fc8a77133196ba8468.zip |
monitor: Make MonitorQMP a child class of Monitor
Currently, struct Monitor mixes state that is only relevant for HMP,
state that is only relevant for QMP, and some actually shared state.
In particular, a MonitorQMP field is present in the state of any
monitor, even if it's not a QMP monitor and therefore doesn't use the
state.
As a first step towards a clean separation between QMP and HMP, let
MonitorQMP extend Monitor and create a MonitorQMP object only when the
monitor is actually a QMP monitor.
Some places accessed Monitor.qmp unconditionally, even for HMP monitors.
They can't keep doing this now, so during the conversion, they are
either changed to become conditional on monitor_is_qmp() or to assert()
that they always get a QMP monitor.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20190613153405.24769-4-kwolf@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Superfluous variable in monitor_data_destroy() eliminated]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'include/monitor/monitor.h')
0 files changed, 0 insertions, 0 deletions