qemu-devel
[Top][All Lists]
Advanced

[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: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH v2 05/11] monitor: Move cmd_table to MonitorHMP
Date: Wed, 12 Jun 2019 13:45:22 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)

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.

[...]



reply via email to

[Prev in Thread] Current Thread [Next in Thread]