qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH RFC V1 02/11] qemu-timer: Introduce qemu_run_one


From: Jan Kiszka
Subject: Re: [Qemu-devel] [PATCH RFC V1 02/11] qemu-timer: Introduce qemu_run_one_timer
Date: Tue, 04 Oct 2011 19:27:31 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

On 2011-10-04 16:51, Anthony PERARD wrote:
> Used by the Xen PCI Passthrough code to run the timer about the power
> state transition.
> 
> Signed-off-by: Anthony PERARD <address@hidden>
> ---
>  qemu-timer.c |   15 +++++++++++++++
>  qemu-timer.h |    3 +++
>  2 files changed, 18 insertions(+), 0 deletions(-)
> 
> diff --git a/qemu-timer.c b/qemu-timer.c
> index 46dd483..15e659b 100644
> --- a/qemu-timer.c
> +++ b/qemu-timer.c
> @@ -1163,3 +1163,18 @@ int qemu_calculate_timeout(void)
>      return 1000;
>  }
>  
> +/* run the specified timer */
> +void qemu_run_one_timer(QEMUTimer *ts)
> +{
> +    uint64_t current_time;
> +
> +    /* remove timer from the list before calling the callback */
> +    qemu_del_timer(ts);
> +
> +    while ((current_time = qemu_get_clock_ms(rt_clock)) < ts->expire_time)
> +        /* sleep until the expire time */
> +        usleep((ts->expire_time - current_time) * 1000);
> +
> +    /* run the callback */
> +    ts->cb(ts->opaque);
> +}

This looks funny. I can't imagine that this could ever fit into the
standard (asynchronous) QEMU execution model for I/O. Keep it private to
Xen?

Jan

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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