On 08/12/2015 01:46 PM, [email protected] wrote: > From: Marc-André Lureau <[email protected]> > > Do not let the hash table grow without limit, schedule a cleanup for > outdated event. > > Signed-off-by: Marc-André Lureau <[email protected]> > --- > 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
