From: Marc-André Lureau <marcandre.lur...@redhat.com> QAPI_EVENT_VSERPORT_CHANGE reports changes of a virtio serial port state. However, the events may be for different ports, but the throttle mechanism may replace the event for a different port, since it only checks the event type.
The following series implements throttling of events based on the "id" field. Hopefully this hash table approach can be later extended if other fields or combination of fields have to be used. v1->v2: - split first patch in 2 to ease review - remove some extra space - add some comments above delay handler function, and struct fields - rename the delay handler data "delay_data" - add a trace in monitor_protocol_event_delay() - improve some commit messages - simplify monitor_qapi_event_delay() - add some comment assert code in monitor_qapi_event_id_delay() to ensure the given pending struct is valid - fixed hashtable key leak - rename qdict "data" argument to "qdict" - removed superfluous parenthesis - use a single timer handler for doing "id" filtering cleanup Marc-André Lureau (5): monitor: split MonitorQAPIEventState monitor: introduce MonitorQAPIEventDelay callback monitor: rename QDict *data->qdict monitor: throttle QAPI_EVENT_VSERPORT_CHANGE by "id" monitor: remove old entries from event hash table monitor.c | 256 ++++++++++++++++++++++++++++++++++++++++++++++------------- trace-events | 3 +- 2 files changed, 203 insertions(+), 56 deletions(-) -- 2.4.3