On 09/25/2015 08:00 AM, Markus Armbruster wrote:
> In preparation of finer grained throttling.
> 
> Signed-off-by: Markus Armbruster <arm...@redhat.com>
> ---
>  monitor.c | 55 ++++++++++++++++++++++++++++++++++++++-----------------
>  1 file changed, 38 insertions(+), 17 deletions(-)
> 

> @@ -512,6 +518,14 @@ monitor_qapi_event_queue(QAPIEvent event, QDict *qdict, 
> Error **errp)
>              int64_t now = qemu_clock_get_ns(QEMU_CLOCK_REALTIME);
>  
>              monitor_qapi_event_emit(event, qdict);
> +
> +            evstate = g_new(MonitorQAPIEventState, 1);
> +            evstate->event = event;
> +            evstate->qdict = NULL;
> +            evstate->timer = 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 <ebl...@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to