Commit 23fabed1 authored by Luiz Capitulino's avatar Luiz Capitulino Committed by Anthony Liguori
Browse files

QMP: Fix asynchronous events delivery



Commit f039a563 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.

Signed-off-by: default avatarLuiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
parent dc0d4efc
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -377,11 +377,10 @@ void monitor_protocol_event(MonitorEvent event, QObject *data)
    }

    QLIST_FOREACH(mon, &mon_list, entry) {
        if (!monitor_ctrl_mode(mon))
            return;

        if (monitor_ctrl_mode(mon)) {
            monitor_json_emitter(mon, QOBJECT(qmp));
        }
    }
    QDECREF(qmp);
}