Skip to contentSkip to conversation

QMP: Fix asynchronous events delivery

PATCH Applied Luiz Capitulino 3 participants 3 messages Jan 20, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 QMP: Fix asynchronous events delivery

Commit f039a563f200beee80cc10fd70b21ea396979dab introduces a regression as monitor_protocol_event() will return in the first user Monitor it finds in the QLIST_FOREACH() loop.

The right thing to do is to only delivery an asynchronous event if the 'mon' is a QMP Monitor.

The aforementioned commit was an early version, if it was applied to stable (it should) this one has to be applied there too.

---
 monitor.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
monitor.c +3 -4
index 938eb3b..b2b88c1 100644
@@ -377,10 +377,9 @@ void monitor_protocol_event(MonitorEvent event, QObject *data)
     }
 
     QLIST_FOREACH(mon, &mon_list, entry) {
-        if (!monitor_ctrl_mode(mon))
-            return;
-
-        monitor_json_emitter(mon, QOBJECT(qmp));
+        if (monitor_ctrl_mode(mon)) {
+            monitor_json_emitter(mon, QOBJECT(qmp));
+        }
     }
     QDECREF(qmp);
 }
Signature · 1 line
1.6.6
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Luiz Capitulino

Commit f039a563f200beee80cc10fd70b21ea396979dab introduces a regression as monitor_protocol_event() will return in the first user Monitor it finds in the QLIST_FOREACH() loop.

Quoted 8 lines

The right thing to do is to only delivery an asynchronous event if the 'mon' is a QMP Monitor.

The aforementioned commit was an early version, if it was applied to stable (it should) this one has to be applied there too.

Signature · 2 lines
Thanks,
Adam
#2 lore raw
In reply to Luiz Capitulino
Quoted 5 lines · Luiz Capitulino

Commit f039a563f200beee80cc10fd70b21ea396979dab introduces a regression as monitor_protocol_event() will return in the first user Monitor it finds in the QLIST_FOREACH() loop.

Quoted 9 lines

The right thing to do is to only delivery an asynchronous event if the 'mon' is a QMP Monitor.

The aforementioned commit was an early version, if it was applied to stable (it should) this one has to be applied there too.

Applied. Thanks.

Regards,

Anthony Liguori

Quoted 23 lines
---
  monitor.c |    7 +++----
  1 files changed, 3 insertions(+), 4 deletions(-)
monitor.c +3 -4
index 938eb3b..b2b88c1 100644
@@ -377,10 +377,9 @@ void monitor_protocol_event(MonitorEvent event, QObject *data)
      }
 
      QLIST_FOREACH(mon,&mon_list, entry) {
-        if (!monitor_ctrl_mode(mon))
-            return;
-
-        monitor_json_emitter(mon, QOBJECT(qmp));
+        if (monitor_ctrl_mode(mon)) {
+            monitor_json_emitter(mon, QOBJECT(qmp));
+        }
      }
      QDECREF(qmp);
  }