[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 03/11] monitor: Make MonitorQMP a child class
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v2 03/11] monitor: Make MonitorQMP a child class of Monitor |
Date: |
Wed, 12 Jun 2019 13:28:07 +0200 |
User-agent: |
Mutt/1.11.3 (2019-02-01) |
Am 12.06.2019 um 09:59 hat Markus Armbruster geschrieben:
> Kevin Wolf <address@hidden> writes:
>
> > 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.
> >
> > Signed-off-by: Kevin Wolf <address@hidden>
> > Reviewed-by: Dr. David Alan Gilbert <address@hidden>
>
> This is a bit harder to review than necessary, because it mixes the
> largely mechanical "replace QMP member by child class" with the
> necessary prerequisite "clean up to access QMP stuff only when the
> monitor is actually a QMP monitor". I'm going to post a split.
>
> Effectively preexisting: we go from Monitor * to MonitorQMP * without
> checking in several places. I'll throw in assertions.
Since I don't think doing both in one patch makes review a lot harder
(and in fact think your patch 2.5 is harder to review for completeness
that the combined patch) and since both Dave and you already reviewed
the patch in its current form and I don't want to invalidate that
review, I'm going to keep it as a single patch and just squash in the
additional assertions where container_of() is used. The resulting code
is the same anyway.
Kevin
- Re: [Qemu-devel] [PATCH v2 04/11] monitor: Create MonitorHMP with readline state, (continued)
[Qemu-devel] [PATCH v2 05/11] monitor: Move cmd_table to MonitorHMP, Kevin Wolf, 2019/06/11
[Qemu-devel] [PATCH v2 03/11] monitor: Make MonitorQMP a child class of Monitor, Kevin Wolf, 2019/06/11
[Qemu-devel] [PATCH v2 07/11] monitor: Move {hmp, qmp}.c to monitor/{hmp, qmp}-cmds.c, Kevin Wolf, 2019/06/11
[Qemu-devel] [PATCH v2 06/11] Move monitor.c to monitor/misc.c, Kevin Wolf, 2019/06/11
[Qemu-devel] [PATCH v2 08/11] monitor: Create monitor_int.h with common definitions, Kevin Wolf, 2019/06/11