All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>
Subject: [Qemu-devel] [PULL 06/16] monitor: Remove Monitor.cmd_table indirection
Date: Mon, 17 Jun 2019 20:48:53 +0200	[thread overview]
Message-ID: <20190617184903.19436-7-armbru@redhat.com> (raw)
In-Reply-To: <20190617184903.19436-1-armbru@redhat.com>

From: Kevin Wolf <kwolf@redhat.com>

Monitor.cmd_table is initialised to point to mon_cmds and never changed
afterwards. We can remove the indirection and just reference mon_cmds
directly instead.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20190613153405.24769-6-kwolf@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 monitor.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/monitor.c b/monitor.c
index 7c57308e2a..6fb9fa285c 100644
--- a/monitor.c
+++ b/monitor.c
@@ -193,7 +193,6 @@ struct Monitor {
     bool use_io_thread;
 
     gchar *mon_cpu_path;
-    mon_cmd_t *cmd_table;
     QTAILQ_ENTRY(Monitor) entry;
 
     /*
@@ -722,8 +721,6 @@ static void monitor_data_init(Monitor *mon, int flags, bool skip_flush,
     }
     qemu_mutex_init(&mon->mon_lock);
     mon->outbuf = qstring_new();
-    /* Use *mon_cmds by default. */
-    mon->cmd_table = mon_cmds;
     mon->skip_flush = skip_flush;
     mon->use_io_thread = use_io_thread;
     mon->flags = flags;
@@ -1024,7 +1021,7 @@ static void help_cmd(Monitor *mon, const char *name)
     }
 
     /* 2. dump the contents according to parsed args */
-    help_cmd_dump(mon, mon->cmd_table, args, nb_args, 0);
+    help_cmd_dump(mon, mon_cmds, args, nb_args, 0);
 
     free_cmdline_args(args, nb_args);
 }
@@ -3485,7 +3482,7 @@ static void handle_hmp_command(MonitorHMP *mon, const char *cmdline)
 
     trace_handle_hmp_command(mon, cmdline);
 
-    cmd = monitor_parse_command(mon, cmdline, &cmdline, mon->common.cmd_table);
+    cmd = monitor_parse_command(mon, cmdline, &cmdline, mon_cmds);
     if (!cmd) {
         return;
     }
@@ -4132,7 +4129,7 @@ static void monitor_find_completion(void *opaque,
     }
 
     /* 2. auto complete according to args */
-    monitor_find_completion_by_table(mon, mon->common.cmd_table, args, nb_args);
+    monitor_find_completion_by_table(mon, mon_cmds, args, nb_args);
 
 cleanup:
     free_cmdline_args(args, nb_args);
-- 
2.21.0



  parent reply	other threads:[~2019-06-17 19:17 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-17 18:48 [Qemu-devel] [PULL 00/16] Monitor patches for 2019-06-17 Markus Armbruster
2019-06-17 18:48 ` [Qemu-devel] [PULL 01/16] monitor: Fix return type of monitor_fdset_dup_fd_find Markus Armbruster
2019-06-17 18:48 ` [Qemu-devel] [PULL 02/16] monitor: Remove unused password prompting fields Markus Armbruster
2019-06-17 18:48 ` [Qemu-devel] [PULL 03/16] monitor: Split monitor_init in HMP and QMP function Markus Armbruster
2019-06-17 18:48 ` [Qemu-devel] [PULL 04/16] monitor: Make MonitorQMP a child class of Monitor Markus Armbruster
2019-06-17 18:48 ` [Qemu-devel] [PULL 05/16] monitor: Create MonitorHMP with readline state Markus Armbruster
2019-06-17 18:48 ` Markus Armbruster [this message]
2019-06-17 18:48 ` [Qemu-devel] [PULL 07/16] monitor: Rename HMP command type and tables Markus Armbruster
2019-06-17 18:48 ` [Qemu-devel] [PULL 08/16] Move monitor.c to monitor/misc.c Markus Armbruster
2019-06-17 18:48 ` [Qemu-devel] [PULL 09/16] monitor: Move {hmp, qmp}.c to monitor/{hmp, qmp}-cmds.c Markus Armbruster
2019-06-17 18:48 ` [Qemu-devel] [PULL 10/16] monitor: Create monitor-internal.h with common definitions Markus Armbruster
2019-06-17 18:48 ` [Qemu-devel] [PULL 11/16] monitor: Split out monitor/qmp.c Markus Armbruster
2019-06-17 18:48 ` [Qemu-devel] [PULL 12/16] monitor: Split out monitor/hmp.c Markus Armbruster
2019-06-17 18:49 ` [Qemu-devel] [PULL 13/16] monitor: Split out monitor/monitor.c Markus Armbruster
2019-06-17 18:49 ` [Qemu-devel] [PULL 14/16] monitor: Split Monitor.flags into separate bools Markus Armbruster
2019-06-17 18:49 ` [Qemu-devel] [PULL 15/16] monitor: Replace monitor_init() with monitor_init_{hmp, qmp}() Markus Armbruster
2019-06-17 18:49 ` [Qemu-devel] [PULL 16/16] vl: Deprecate -mon pretty=... for HMP monitors Markus Armbruster
2019-06-18  9:01   ` Daniel P. Berrangé
2019-06-18 10:34     ` Kevin Wolf
2019-06-19  6:42       ` Markus Armbruster
2019-06-19  9:18         ` Kevin Wolf
2019-06-19  9:20           ` Daniel P. Berrangé
2019-06-17 18:58 ` [Qemu-devel] [PULL 00/16] Monitor patches for 2019-06-17 Peter Maydell
2019-06-18  6:07   ` Markus Armbruster
2019-06-17 20:04 ` no-reply
2019-06-17 22:49 ` no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190617184903.19436-7-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.