aboutsummaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/monitor.c b/monitor.c
index fea73834d0..938eb3b041 100644
--- a/monitor.c
+++ b/monitor.c
@@ -334,13 +334,10 @@ void monitor_protocol_event(MonitorEvent event, QObject *data)
{
QDict *qmp;
const char *event_name;
- Monitor *mon = cur_mon;
+ Monitor *mon;
assert(event < QEVENT_MAX);
- if (!monitor_ctrl_mode(mon))
- return;
-
switch (event) {
case QEVENT_DEBUG:
event_name = "DEBUG";
@@ -379,7 +376,12 @@ void monitor_protocol_event(MonitorEvent event, QObject *data)
qdict_put_obj(qmp, "data", data);
}
- monitor_json_emitter(mon, QOBJECT(qmp));
+ QLIST_FOREACH(mon, &mon_list, entry) {
+ if (!monitor_ctrl_mode(mon))
+ return;
+
+ monitor_json_emitter(mon, QOBJECT(qmp));
+ }
QDECREF(qmp);
}