[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC 3/3] monitor: remove old entries from event hash t
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [RFC 3/3] monitor: remove old entries from event hash table |
Date: |
Tue, 1 Sep 2015 14:28:01 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 |
On 08/12/2015 01:46 PM, address@hidden wrote:
> From: Marc-André Lureau <address@hidden>
>
> Do not let the hash table grow without limit, schedule a cleanup for
> outdated event.
>
> Signed-off-by: Marc-André Lureau <address@hidden>
> ---
> 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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [RFC 3/3] monitor: remove old entries from event hash table,
Eric Blake <=