]> git.proxmox.com Git - qemu.git/commit - trace-events
Add rate limiting of RTC_CHANGE, BALLOON_CHANGE & WATCHDOG events
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 14 Jun 2012 17:12:57 +0000 (18:12 +0100)
committerLuiz Capitulino <lcapitulino@redhat.com>
Fri, 15 Jun 2012 16:35:00 +0000 (13:35 -0300)
commitafeecec2e8e99ba184c487633d5d0dde68a002ac
tree684e8964ba4d983d23841760b45de6661fb3309e
parent973603a813c5d60534b4fa0313f83be40e2b9c47
Add rate limiting of RTC_CHANGE, BALLOON_CHANGE & WATCHDOG events

Allow certain event types to be rate limited to avoid flooding
monitor clients. The monitor_protocol_event() method is changed
such that instead of immediately emitting the event to Monitor
instances, it will call a new monitor_protocol_event_queue()
method.

This will check to see if the rate limit for the event has been
exceeded, and if so schedule a timer to wakeup at the end of the
rate limit period. If further events arrive before the timer fires,
the previously queued event will be discarded in favour of the new
event. The event will eventually be emitted when the timer fires.

This logic is applied to RTC_CHANGE, BALLOON_CHANGE & WATCHDOG
events, since the data associated with these events is stateless

 * monitor.c: Add support for rate limiting
 * monitor.h: Define monitor_global_init for one-time setup tasks
 * vl.c: Invoke monitor_global_init
 * trace-events: Add hooks for monitor event tracing

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Acked-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
monitor.c
trace-events