From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33340) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWsA2-0002Fx-IW for qemu-devel@nongnu.org; Tue, 01 Sep 2015 16:28:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWs9z-0001TU-78 for qemu-devel@nongnu.org; Tue, 01 Sep 2015 16:28:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50177) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWs9z-0001TI-30 for qemu-devel@nongnu.org; Tue, 01 Sep 2015 16:28:03 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id B015DC0EE042 for ; Tue, 1 Sep 2015 20:28:02 +0000 (UTC) References: <1439408763-12785-1-git-send-email-marcandre.lureau@redhat.com> <1439408763-12785-4-git-send-email-marcandre.lureau@redhat.com> From: Eric Blake Message-ID: <55E60A51.3030400@redhat.com> Date: Tue, 1 Sep 2015 14:28:01 -0600 MIME-Version: 1.0 In-Reply-To: <1439408763-12785-4-git-send-email-marcandre.lureau@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="kFmKhfIA7vbCJP73J1hLI8LnDF3wKi7lW" Subject: Re: [Qemu-devel] [RFC 3/3] monitor: remove old entries from event hash table List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: marcandre.lureau@redhat.com, qemu-devel@nongnu.org Cc: lersek@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --kFmKhfIA7vbCJP73J1hLI8LnDF3wKi7lW Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 08/12/2015 01:46 PM, marcandre.lureau@redhat.com wrote: > From: Marc-Andr=C3=A9 Lureau >=20 > Do not let the hash table grow without limit, schedule a cleanup for > outdated event. >=20 > Signed-off-by: Marc-Andr=C3=A9 Lureau > --- > monitor.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++++--- > 1 file changed, 48 insertions(+), 3 deletions(-) >=20 > @@ -554,7 +593,13 @@ monitor_qapi_event_id_delay(MonitorQAPIEventState = *evstate, QDict *data) > g_hash_table_insert(ht, g_strdup(id), p); > } > =20 > - return monitor_qapi_event_pending_update(evstate, p, data); > + if (monitor_qapi_event_pending_update(evstate, p, data)) { > + p->timer->cb =3D 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. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --kFmKhfIA7vbCJP73J1hLI8LnDF3wKi7lW Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJV5gpRAAoJEKeha0olJ0Nq5OsIAJ6yNU8V3tKNjEsafZ0Elj5y N+zXxskSOyNQKwZzx08oD4PeU4mTWQrs1ItZt1C5eTsZ5i71g40aGG7xi2hT7h0h z+EGuZJj2jBgio3LWa31d4j7aRiEtsHalCW4qOSdl++1YNkosX9F5VVQuzxrZi1M drvCt6NHfHMHSB2qIo/xfik1KighofEglCg+nYkSTcEwlr61E1Cr6zCEZSVmH3Q6 Klv1j+6gBzCboNctel/Ww39HZOb2bvuoEDx9XBMLz6zZXQx42txNLyIiOSZj6BaQ vcv5E7EgaMz/GOwDdBD6B8leKz5hbOJItLF1SJhvXNy+beZgMF3nLszwpFcssSY= =85dt -----END PGP SIGNATURE----- --kFmKhfIA7vbCJP73J1hLI8LnDF3wKi7lW--