[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC v2 12/22] monitor: let mon_list be tail queue
From: |
Peter Xu |
Subject: |
[Qemu-devel] [RFC v2 12/22] monitor: let mon_list be tail queue |
Date: |
Fri, 29 Sep 2017 11:38:34 +0800 |
It was QLIST. I want to use this list to do monitor priority job later,
which need tail insertion ability. So switching to a tail queue.
Signed-off-by: Peter Xu <address@hidden>
---
monitor.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/monitor.c b/monitor.c
index 0caf2019c1..7b76dff5ad 100644
--- a/monitor.c
+++ b/monitor.c
@@ -207,7 +207,7 @@ struct Monitor {
void *password_opaque;
mon_cmd_t *cmd_table;
QLIST_HEAD(,mon_fd_t) fds;
- QLIST_ENTRY(Monitor) entry;
+ QTAILQ_ENTRY(Monitor) entry;
};
struct MonitorGlobal {
@@ -222,7 +222,7 @@ static struct MonitorGlobal mon_global;
/* Protects mon_list, monitor_event_state. */
static QemuMutex monitor_lock;
-static QLIST_HEAD(mon_list, Monitor) mon_list;
+static QTAILQ_HEAD(mon_list, Monitor) mon_list;
static QLIST_HEAD(mon_fdsets, MonFdset) mon_fdsets;
static int mon_refcount;
@@ -423,7 +423,7 @@ static void monitor_qapi_event_emit(QAPIEvent event, QDict
*qdict)
Monitor *mon;
trace_monitor_protocol_event_emit(event, qdict);
- QLIST_FOREACH(mon, &mon_list, entry) {
+ QTAILQ_FOREACH(mon, &mon_list, entry) {
if (monitor_is_qmp(mon)
&& mon->qmp.commands != &qmp_cap_negotiation_commands) {
monitor_json_emitter(mon, QOBJECT(qdict));
@@ -4204,8 +4204,8 @@ void monitor_cleanup(void)
iothread_stop(mon_global.mon_io_thread);
qemu_mutex_lock(&monitor_lock);
- QLIST_FOREACH_SAFE(mon, &mon_list, entry, next) {
- QLIST_REMOVE(mon, entry);
+ QTAILQ_FOREACH_SAFE(mon, &mon_list, entry, next) {
+ QTAILQ_REMOVE(&mon_list, mon, entry);
monitor_data_destroy(mon);
g_free(mon);
}
--
2.13.5
- [Qemu-devel] [RFC v2 02/22] qobject: introduce qstring_get_try_str(), (continued)
- [Qemu-devel] [RFC v2 02/22] qobject: introduce qstring_get_try_str(), Peter Xu, 2017/09/28
- [Qemu-devel] [RFC v2 03/22] qobject: introduce qobject_get_try_str(), Peter Xu, 2017/09/28
- [Qemu-devel] [RFC v2 04/22] qobject: let object_property_get_str() use new API, Peter Xu, 2017/09/28
- [Qemu-devel] [RFC v2 05/22] monitor: move skip_flush into monitor_data_init, Peter Xu, 2017/09/28
- [Qemu-devel] [RFC v2 06/22] qjson: add "opaque" field to JSONMessageParser, Peter Xu, 2017/09/28
- [Qemu-devel] [RFC v2 08/22] monitor: unify global init, Peter Xu, 2017/09/28
- [Qemu-devel] [RFC v2 07/22] monitor: move the cur_mon hack deeper for QMP, Peter Xu, 2017/09/28
- [Qemu-devel] [RFC v2 09/22] monitor: create monitor dedicate iothread, Peter Xu, 2017/09/28
- [Qemu-devel] [RFC v2 10/22] monitor: allow to use IO thread for parsing, Peter Xu, 2017/09/28
- [Qemu-devel] [RFC v2 11/22] monitor: introduce monitor_qmp_respond(), Peter Xu, 2017/09/28
- [Qemu-devel] [RFC v2 12/22] monitor: let mon_list be tail queue,
Peter Xu <=
- [Qemu-devel] [RFC v2 13/22] monitor: separate QMP parser and dispatcher, Peter Xu, 2017/09/28
- [Qemu-devel] [RFC v2 14/22] qmp: add new event "request-dropped", Peter Xu, 2017/09/28
- [Qemu-devel] [RFC v2 15/22] monitor: send event when request queue full, Peter Xu, 2017/09/28
- [Qemu-devel] [RFC v2 16/22] monitor: enable IO thread for (qmp & !mux) typed, Peter Xu, 2017/09/28
- [Qemu-devel] [RFC v2 17/22] qapi: introduce new cmd option "allow-oob", Peter Xu, 2017/09/28
- [Qemu-devel] [RFC v2 18/22] qmp: support out-of-band (oob) execution, Peter Xu, 2017/09/28
- [Qemu-devel] [RFC v2 19/22] qmp: let migrate-incoming allow out-of-band, Peter Xu, 2017/09/28
- [Qemu-devel] [RFC v2 20/22] qmp: isolate responses into io thread, Peter Xu, 2017/09/28
- [Qemu-devel] [RFC v2 21/22] qmp: introduce QMPCapability, Peter Xu, 2017/09/28
- [Qemu-devel] [RFC v2 22/22] docs: update QMP documents for OOB commands, Peter Xu, 2017/09/28