qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 3/7] monitor: Switch from timer_new() to timer_n


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 3/7] monitor: Switch from timer_new() to timer_new_ns()
Date: Thu, 15 Oct 2015 16:44:57 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 10/15/2015 09:08 AM, Markus Armbruster wrote:
> We don't actually care for the scale, so we can just as well use the
> simpler interface.
> 
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
>  monitor.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/monitor.c b/monitor.c
> index ca201fd..baffd76 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -545,10 +545,9 @@ monitor_qapi_event_throttle(QAPIEvent event, int64_t 
> rate)
>      assert(rate * SCALE_MS <= INT64_MAX);

A bit unrelated:

Isn't this assertion risky, compared to:

assert(rate <= INT64_MAX / SCALE_MS);

>      evstate->rate = rate * SCALE_MS;
>      evstate->qdict = NULL;
> -    evstate->timer = timer_new(QEMU_CLOCK_REALTIME,
> -                               SCALE_MS,
> -                               monitor_qapi_event_handler,
> -                               evstate);
> +    evstate->timer = timer_new_ns(QEMU_CLOCK_REALTIME,
> +                                  monitor_qapi_event_handler,
> +                                  evstate);
>  }

Reviewed-by: Eric Blake <address@hidden>

-- 
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

[Prev in Thread] Current Thread [Next in Thread]