/* Event-specific data can be emitted through the (optional) 'data' parameter.  */
void monitor_protocol_event(MonitorEvent event, QObject *data)
/* Event-specific data can be emitted through the (optional) 'data' parameter.  */
void monitor_protocol_event(MonitorEvent event, QObject *data)
{
    QDict *qmp;
    const char *event_name;
    assert(event < QEVENT_MAX);
    event_name = monitor_event_names[event];
    assert(event_name != NULL);
    qmp = qdict_new();
    timestamp_put(qmp);
    qdict_put(qmp, "event", qstring_from_str(event_name));
    if (data) {
        qobject_incref(data);
        qdict_put_obj(qmp, "data", data);
    }
    trace_monitor_protocol_event(event, event_name, qmp);
    monitor_protocol_event_queue(event, QOBJECT(qmp));
    QDECREF(qmp);
}