Received: from eggs.gnu.org ([2001:4830:134:3::10]:53969) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgTjh-0002dj-R6 for qemu-devel@nongnu.org; Mon, 28 Sep 2015 04:24:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZgTjd-0005pU-TJ for qemu-devel@nongnu.org; Mon, 28 Sep 2015 04:24:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59520) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZgTjd-0005pB-O8 for qemu-devel@nongnu.org; Mon, 28 Sep 2015 04:24:33 -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 28DDAC0B1B55 for ; Mon, 28 Sep 2015 08:24:33 +0000 (UTC) From: Markus Armbruster References: <1443189647-11417-1-git-send-email-armbru@redhat.com> <1443189647-11417-4-git-send-email-armbru@redhat.com> <56059D50.4070401@redhat.com> Date: Mon, 28 Sep 2015 10:24:30 +0200 In-Reply-To: <56059D50.4070401@redhat.com> (Eric Blake's message of "Fri, 25 Sep 2015 13:15:28 -0600") Message-ID: <878u7rlznl.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [RFC 3/6] monitor: Split MonitorQAPIEventConf off MonitorQAPIEventState List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: amit.shah@redhat.com, marcandre.lureau@redhat.com, lersek@redhat.com, qemu-devel@nongnu.org Eric Blake writes: > On 09/25/2015 08:00 AM, Markus Armbruster wrote: >> In preparation of turning monitor_qapi_event_state[] into a hash table >> for finer grained throttling. >> >> Signed-off-by: Markus Armbruster >> --- >> monitor.c | 79 ++++++++++++++++++++++++++++++--------------------------------- >> 1 file changed, 38 insertions(+), 41 deletions(-) >> > >> -/* >> - * @event: the event ID to be limited >> - * @rate: the rate limit in milliseconds >> - * >> - * Sets a rate limit on a particular event, so no >> - * more than 1 event will be emitted within @rate >> - * milliseconds >> - */ >> -static void >> -monitor_qapi_event_throttle(QAPIEvent event, int64_t rate) >> -{ > > At one point, I think we were considering having the rate be > user-tunable through a qom property, in which case this function is > still nicer than a monitor_qapi_event_conf[] fixed-rate table. But > since I don't think we ever used it, I'm fine with dropping the > complexity and living with a constant rate. I'm no friend on complicating stuff now to hopefully facilitate things we might want to do some day, but don't really understand now. Say we provide a way for the user to configure the rate. Say you accidentally set the rate to a month, and now want to fix your blunder by setting it to a minute. If an event has already arrived, the timer is currently set to expire next month, and your fixed rate will take effect then. My point is configuring the rate could be more complicated than storing the new rate, and keeping monitor_qapi_event_throttle() around won't make the job materially easier. > Reviewed-by: Eric Blake Thanks!