[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 20/21] monitor: Rename monitor_ctrl_mode() to monitor
From: |
Markus Armbruster |
Subject: |
[Qemu-devel] [PULL 20/21] monitor: Rename monitor_ctrl_mode() to monitor_is_qmp() |
Date: |
Tue, 2 Jun 2015 10:23:58 +0200 |
... and change return type to bool.
Signed-off-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Luiz Capitulino <address@hidden>
---
monitor.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/monitor.c b/monitor.c
index 0550283..be18ac1 100644
--- a/monitor.c
+++ b/monitor.c
@@ -231,8 +231,10 @@ Monitor *default_mon;
static void monitor_command_cb(void *opaque, const char *cmdline,
void *readline_opaque);
-/* Return true if in control mode, false otherwise */
-static inline int monitor_ctrl_mode(const Monitor *mon)
+/**
+ * Is @mon a QMP monitor?
+ */
+static inline bool monitor_is_qmp(const Monitor *mon)
{
return (mon->flags & MONITOR_USE_CONTROL);
}
@@ -240,7 +242,7 @@ static inline int monitor_ctrl_mode(const Monitor *mon)
/* Return non-zero iff we have a current monitor, and it is in QMP mode. */
int monitor_cur_is_qmp(void)
{
- return cur_mon && monitor_ctrl_mode(cur_mon);
+ return cur_mon && monitor_is_qmp(cur_mon);
}
void monitor_read_command(Monitor *mon, int show_prompt)
@@ -350,7 +352,7 @@ void monitor_vprintf(Monitor *mon, const char *fmt, va_list
ap)
if (!mon)
return;
- if (monitor_ctrl_mode(mon)) {
+ if (monitor_is_qmp(mon)) {
return;
}
@@ -446,7 +448,7 @@ static void monitor_qapi_event_emit(QAPIEvent event,
QObject *data)
trace_monitor_protocol_event_emit(event, data);
QLIST_FOREACH(mon, &mon_list, entry) {
- if (monitor_ctrl_mode(mon) && mon->qmp.in_command_mode) {
+ if (monitor_is_qmp(mon) && mon->qmp.in_command_mode) {
monitor_json_emitter(mon, data);
}
}
@@ -5251,7 +5253,7 @@ void monitor_init(CharDriverState *chr, int flags)
monitor_read_command(mon, 0);
}
- if (monitor_ctrl_mode(mon)) {
+ if (monitor_is_qmp(mon)) {
qemu_chr_add_handlers(chr, monitor_can_read, monitor_qmp_read,
monitor_qmp_event, mon);
qemu_chr_fe_set_echo(chr, true);
--
1.9.3
- [Qemu-devel] [PULL 02/21] monitor: Clean up after previous commit, (continued)
- [Qemu-devel] [PULL 02/21] monitor: Clean up after previous commit, Markus Armbruster, 2015/06/02
- [Qemu-devel] [PULL 12/21] monitor: Wean monitor_protocol_emitter() off mon->error, Markus Armbruster, 2015/06/02
- [Qemu-devel] [PULL 05/21] monitor: Use traditional command interface for HMP drive_del, Markus Armbruster, 2015/06/02
- [Qemu-devel] [PULL 06/21] monitor: Use traditional command interface for HMP device_add, Markus Armbruster, 2015/06/02
- [Qemu-devel] [PULL 09/21] monitor: Propagate errors through qmp_check_client_args(), Markus Armbruster, 2015/06/02
- [Qemu-devel] [PULL 07/21] monitor: Use trad. command interface for HMP pcie_aer_inject_error, Markus Armbruster, 2015/06/02
- [Qemu-devel] [PULL 03/21] monitor: Improve and document client_migrate_info protocol error, Markus Armbruster, 2015/06/02
- [Qemu-devel] [PULL 04/21] monitor: Convert client_migrate_info to QAPI, Markus Armbruster, 2015/06/02
- [Qemu-devel] [PULL 01/21] monitor: Drop broken, unused asynchronous command interface, Markus Armbruster, 2015/06/02
- [Qemu-devel] [PULL 13/21] monitor: Inline monitor_has_error() into its only caller, Markus Armbruster, 2015/06/02
- [Qemu-devel] [PULL 20/21] monitor: Rename monitor_ctrl_mode() to monitor_is_qmp(),
Markus Armbruster <=
- [Qemu-devel] [PULL 21/21] monitor: Change return type of monitor_cur_is_qmp() to bool, Markus Armbruster, 2015/06/02
- [Qemu-devel] [PULL 10/21] monitor: Propagate errors through qmp_check_input_obj(), Markus Armbruster, 2015/06/02
- [Qemu-devel] [PULL 16/21] monitor: Rename monitor_control_read(), monitor_control_event(), Markus Armbruster, 2015/06/02
- [Qemu-devel] [PULL 15/21] monitor: Rename handle_user_command() to handle_hmp_command(), Markus Armbruster, 2015/06/02
- [Qemu-devel] [PULL 18/21] monitor: Drop do_qmp_capabilities()'s superfluous QMP check, Markus Armbruster, 2015/06/02
- [Qemu-devel] [PULL 19/21] monitor: Turn int command_mode into bool in_command_mode, Markus Armbruster, 2015/06/02
- [Qemu-devel] [PULL 17/21] monitor: Unbox Monitor member mc and rename to qmp, Markus Armbruster, 2015/06/02
- [Qemu-devel] [PULL 14/21] monitor: Limit QError use to command handlers, Markus Armbruster, 2015/06/02
- Re: [Qemu-devel] [PULL 00/21] Monitor patches, Peter Maydell, 2015/06/04