qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] main-loop: Fix build for w32 and w64


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] main-loop: Fix build for w32 and w64
Date: Sat, 28 Apr 2012 16:34:15 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1

Il 27/04/2012 17:02, Stefan Weil ha scritto:

> diff --git a/main-loop.c b/main-loop.c
> index 0457bf2..24cf540 100644
> --- a/main-loop.c
> +++ b/main-loop.c
> @@ -410,6 +410,7 @@ static int os_host_main_loop_wait(uint32_t timeout)
>      int ret, i;
>      PollingEntry *pe;
>      WaitObjects *w = &wait_objects;
> +    gint poll_timeout;
>      static struct timeval tv0;
>  
>      /* XXX: need to suppress polling by better using win32 events */
> @@ -424,12 +425,12 @@ static int os_host_main_loop_wait(uint32_t timeout)
>      if (nfds >= 0) {
>          ret = select(nfds + 1, &rfds, &wfds, &xfds, &tv0);
>          if (ret != 0) {
> -            timeout = 0;
> +            /* TODO. */

Please leave timeout = 0 here and...

>          }
>      }
>  
>      g_main_context_prepare(context, &max_priority);
> -    n_poll_fds = g_main_context_query(context, max_priority, &timeout,
> +    n_poll_fds = g_main_context_query(context, max_priority, &poll_timeout,
>                                        poll_fds, ARRAY_SIZE(poll_fds));
>      g_assert(n_poll_fds <= ARRAY_SIZE(poll_fds));
>  
> @@ -439,7 +440,7 @@ static int os_host_main_loop_wait(uint32_t timeout)
>      }
>  
>      qemu_mutex_unlock_iothread();
> -    ret = g_poll(poll_fds, n_poll_fds + w->num, timeout);

... here do:

    if (poll_timeout == INFINITE || timeout < poll_timeout) {
        poll_timeout = timeout;
    }

> +    ret = g_poll(poll_fds, n_poll_fds + w->num, poll_timeout);
>      qemu_mutex_lock_iothread();
>      if (ret > 0) {
>          for (i = 0; i < w->num; i++) {

Thanks for fixing the breakage.

Paolo



reply via email to

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