On 08/12/2015 01:46 PM, marcandre.lur...@redhat.com wrote: > From: Marc-André Lureau <marcandre.lur...@redhat.com> > > Do not let the hash table grow without limit, schedule a cleanup for > outdated event. > > Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com> > --- > monitor.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++--- > 1 file changed, 48 insertions(+), 3 deletions(-) >
> @@ -554,7 +593,13 @@ monitor_qapi_event_id_delay(MonitorQAPIEventState > *evstate, QDict *data) > g_hash_table_insert(ht, g_strdup(id), p); > } > > - return monitor_qapi_event_pending_update(evstate, p, data); > + if (monitor_qapi_event_pending_update(evstate, p, data)) { > + p->timer->cb = monitor_qapi_event_id_handler; > + return TRUE; > + } else { > + monitor_qapi_event_id_schedule_remove(p); > + return FALSE; Again, prefer 'true' and 'false' for a function that returns bool. Otherwise, looks okay to me, and looking forward to a non-RFC version. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature