[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 05/11] monitor: Move cmd_table to MonitorHMP
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v2 05/11] monitor: Move cmd_table to MonitorHMP |
Date: |
Wed, 12 Jun 2019 15:55:41 +0200 |
User-agent: |
Mutt/1.11.3 (2019-02-01) |
Am 12.06.2019 um 13:45 hat Markus Armbruster geschrieben:
> Kevin Wolf <address@hidden> writes:
>
> > Monitor.cmd_table contains the handlers for HMP commands, so there is no
> > reason to keep it in the state shared with QMP. Move it to MonitorHMP.
> >
> > Signed-off-by: Kevin Wolf <address@hidden>
> > Reviewed-by: Dr. David Alan Gilbert <address@hidden>
> > ---
> > monitor.c | 23 +++++++++++++++--------
> > 1 file changed, 15 insertions(+), 8 deletions(-)
> >
> > diff --git a/monitor.c b/monitor.c
> > index f8730e4462..56af8ed448 100644
> > --- a/monitor.c
> > +++ b/monitor.c
> > @@ -191,7 +191,6 @@ struct Monitor {
> > bool use_io_thread;
> >
> > gchar *mon_cpu_path;
> > - mon_cmd_t *cmd_table;
> > QTAILQ_ENTRY(Monitor) entry;
> >
> > /*
> > @@ -219,6 +218,7 @@ struct MonitorHMP {
> > * These members can be safely accessed without locks.
> > */
> > ReadLineState *rs;
> > + mon_cmd_t *cmd_table;
> > };
> >
> > typedef struct {
> > @@ -720,13 +720,19 @@ static void monitor_data_init(Monitor *mon, int
> > flags, bool skip_flush,
> > memset(mon, 0, sizeof(Monitor));
> > qemu_mutex_init(&mon->mon_lock);
> > mon->outbuf = qstring_new();
> > - /* Use *mon_cmds by default. */
> > - mon->cmd_table = mon_cmds;
>
> As far as I can tell, this is the only assignment to Monitor member
> cmd_table. Why not delete it outright, and use mon_cmds directly?
> Preferably renamed to something like hmp_cmds.
Good idea, I'll do that.
Kevin
- [Qemu-devel] [PATCH v2 01/11] monitor: Remove unused password prompting fields, (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