From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47434) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfYZF-00017F-CQ for qemu-devel@nongnu.org; Fri, 25 Sep 2015 15:22:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfYZB-0001cD-En for qemu-devel@nongnu.org; Fri, 25 Sep 2015 15:22:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40645) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfYZB-0001bt-AM for qemu-devel@nongnu.org; Fri, 25 Sep 2015 15:21:57 -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 A50FA341AF5 for ; Fri, 25 Sep 2015 19:21:56 +0000 (UTC) References: <1443189647-11417-1-git-send-email-armbru@redhat.com> <1443189647-11417-5-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <56059ED3.3030902@redhat.com> Date: Fri, 25 Sep 2015 13:21:55 -0600 MIME-Version: 1.0 In-Reply-To: <1443189647-11417-5-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="lkaV1ioEatEudsOwMoapJfVONcdMtbHRW" Subject: Re: [Qemu-devel] [RFC 4/6] monitor: Turn monitor_qapi_event_state[] into a hash table List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: amit.shah@redhat.com, marcandre.lureau@redhat.com, lersek@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --lkaV1ioEatEudsOwMoapJfVONcdMtbHRW Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/25/2015 08:00 AM, Markus Armbruster wrote: > In preparation of finer grained throttling. >=20 > Signed-off-by: Markus Armbruster > --- > monitor.c | 55 ++++++++++++++++++++++++++++++++++++++-----------------= > 1 file changed, 38 insertions(+), 17 deletions(-) >=20 > @@ -512,6 +518,14 @@ monitor_qapi_event_queue(QAPIEvent event, QDict *q= dict, Error **errp) > int64_t now =3D qemu_clock_get_ns(QEMU_CLOCK_REALTIME); > =20 > monitor_qapi_event_emit(event, qdict); > + > + evstate =3D g_new(MonitorQAPIEventState, 1); > + evstate->event =3D event; > + evstate->qdict =3D NULL; > + evstate->timer =3D timer_new_ns(QEMU_CLOCK_REALTIME, > + monitor_qapi_event_handler, > + evstate); Now timers are created and destroyed dynamically upon use rather than reused and just waiting to be rearmed; I hope there aren't any obvious inefficiencies from doing that. The conversion looks sane: Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --lkaV1ioEatEudsOwMoapJfVONcdMtbHRW 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/ iQEcBAEBCAAGBQJWBZ7TAAoJEKeha0olJ0NqtvIH/3MjtpwZcs5y+xLbYC652rt3 5PWcuxOpdr5MSBdq4oY1wgvHmIKqrieH53ONK3he89W6hwzkFPRo1fr1up0dw32Z jEXbK1T5iSJ13GJ+gHaJ76f8jdRdj9piQ9f1u20CN3gu2DLDNEb0/egLiT052n7/ hXMiszHbfo59lHmcnM4T7kL1cXzsMXQGe2OqXmbd9tlxUvw31Fc69rIkVT1rkXX/ sF6kYpdNoXKRis9Qn29hZ7RUrtIZYky5TBgKrxJ/+6JO6f2BLJiRBJRaU9trDySE qkp3zaLbeWx3Jyui0VwBuVHDAcVT+2QZjZa7PT/mSF9fpc1kD2B0gxoroa1EpuQ= =RkYs -----END PGP SIGNATURE----- --lkaV1ioEatEudsOwMoapJfVONcdMtbHRW--