From: Kevin Wolf <kwolf@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, berrange@redhat.com, qemu-block@nongnu.org,
armbru@redhat.com, dgilbert@redhat.com
Subject: [Qemu-devel] [PATCH v3 05/15] monitor: Remove Monitor.cmd_table indirection
Date: Thu, 13 Jun 2019 17:33:55 +0200 [thread overview]
Message-ID: <20190613153405.24769-6-kwolf@redhat.com> (raw)
In-Reply-To: <20190613153405.24769-1-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>
---
monitor.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/monitor.c b/monitor.c
index 572449f6db..5eacaa48a6 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;
@@ -1026,7 +1023,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);
}
@@ -3487,7 +3484,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;
}
@@ -4134,7 +4131,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.20.1
next prev parent reply other threads:[~2019-06-13 16:37 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-13 15:33 [Qemu-devel] [PATCH v3 00/15] monitor: Split monitor.c in core/HMP/QMP/misc Kevin Wolf
2019-06-13 15:33 ` [Qemu-devel] [PATCH v3 01/15] monitor: Remove unused password prompting fields Kevin Wolf
2019-06-13 15:33 ` [Qemu-devel] [PATCH v3 02/15] monitor: Split monitor_init in HMP and QMP function Kevin Wolf
2019-06-14 8:51 ` Markus Armbruster
2019-06-13 15:33 ` [Qemu-devel] [PATCH v3 03/15] monitor: Make MonitorQMP a child class of Monitor Kevin Wolf
2019-06-14 8:54 ` Markus Armbruster
2019-06-13 15:33 ` [Qemu-devel] [PATCH v3 04/15] monitor: Create MonitorHMP with readline state Kevin Wolf
2019-06-14 8:55 ` Markus Armbruster
2019-06-13 15:33 ` Kevin Wolf [this message]
2019-06-14 5:51 ` [Qemu-devel] [PATCH v3 05/15] monitor: Remove Monitor.cmd_table indirection Markus Armbruster
2019-06-13 15:33 ` [Qemu-devel] [PATCH v3 06/15] monitor: Rename HMP command type and tables Kevin Wolf
2019-06-14 5:52 ` Markus Armbruster
2019-06-14 6:01 ` Markus Armbruster
2019-06-13 15:33 ` [Qemu-devel] [PATCH v3 07/15] Move monitor.c to monitor/misc.c Kevin Wolf
2019-06-14 6:04 ` Markus Armbruster
2019-06-14 6:25 ` Markus Armbruster
2019-06-13 15:33 ` [Qemu-devel] [PATCH v3 08/15] monitor: Move {hmp, qmp}.c to monitor/{hmp, qmp}-cmds.c Kevin Wolf
2019-06-13 15:33 ` [Qemu-devel] [PATCH v3 09/15] monitor: Create monitor-internal.h with common definitions Kevin Wolf
2019-06-14 6:37 ` Markus Armbruster
2019-06-14 8:47 ` Kevin Wolf
2019-06-13 15:34 ` [Qemu-devel] [PATCH v3 10/15] monitor: Split out monitor/qmp.c Kevin Wolf
2019-06-14 6:46 ` Markus Armbruster
2019-06-13 15:34 ` [Qemu-devel] [PATCH v3 11/15] monitor: Split out monitor/hmp.c Kevin Wolf
2019-06-14 8:23 ` Markus Armbruster
2019-06-14 9:17 ` Dr. David Alan Gilbert
2019-06-13 15:34 ` [Qemu-devel] [PATCH v3 12/15] monitor: Split out monitor/monitor.c Kevin Wolf
2019-06-14 8:29 ` Markus Armbruster
2019-06-13 15:34 ` [Qemu-devel] [PATCH v3 13/15] monitor: Split Monitor.flags into separate bools Kevin Wolf
2019-06-14 8:48 ` Markus Armbruster
2019-06-13 15:34 ` [Qemu-devel] [PATCH v3 14/15] monitor: Replace monitor_init() with monitor_init_{hmp, qmp}() Kevin Wolf
2019-06-14 8:50 ` Markus Armbruster
2019-06-13 15:34 ` [Qemu-devel] [PATCH v3 15/15] vl: Deprecate -mon pretty=... for HMP monitors Kevin Wolf
2019-06-14 9:01 ` Markus Armbruster
2019-06-14 9:13 ` Kevin Wolf
2019-06-14 11:14 ` Markus Armbruster
2019-06-13 17:31 ` [Qemu-devel] [PATCH v3 00/15] monitor: Split monitor.c in core/HMP/QMP/misc no-reply
2019-06-14 9:06 ` Markus Armbruster
2019-06-14 9:32 ` Kevin Wolf
2019-06-15 20:31 ` Markus Armbruster
2019-06-17 8:53 ` Kevin Wolf
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=20190613153405.24769-6-kwolf@redhat.com \
--to=kwolf@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=dgilbert@redhat.com \
--cc=qemu-block@nongnu.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).