qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC v1 2/4] util/oslib-win32: Remove invalid check


From: Alistair Francis
Subject: Re: [Qemu-devel] [RFC v1 2/4] util/oslib-win32: Remove invalid check
Date: Wed, 5 Jul 2017 08:44:44 -0700

On Fri, Jun 30, 2017 at 3:37 AM, Paolo Bonzini <address@hidden> wrote:
>
>
> On 29/06/2017 18:37, Alistair Francis wrote:
>>> Hmm, I think it's possible, poll_msgs is true here.
>> poll_msgs?
>>
>> If nhandles is 0 then we have already entered an earlier if statement
>> and set ready to either WAIT_FAILED or WAIT_TIMEOUT in which case we
>> can't enter this part of the if statement.
>
> No, that's not correct.  The code is:
>
>     if (poll_msgs) {
>         /* Wait for either messages or handles
>          * -> Use MsgWaitForMultipleObjectsEx
>          */
>         ready = MsgWaitForMultipleObjectsEx(nhandles, handles, timeout,
>                                             QS_ALLINPUT, MWMO_ALERTABLE);
>
>         if (ready == WAIT_FAILED) {
>             gchar *emsg = g_win32_error_message(GetLastError());
>             g_warning("MsgWaitForMultipleObjectsEx failed: %s", emsg);
>             g_free(emsg);
>         }
>     } else if (nhandles == 0) {
>         /* No handles to wait for, just the timeout */
>         if (timeout == INFINITE) {
>             ready = WAIT_FAILED;
>         } else {
>             SleepEx(timeout, TRUE);
>             ready = WAIT_TIMEOUT;
>         }
>
> You can have poll_msgs == TRUE && nhandles == 0.  This happens for
>
>    GPollFD fds[1] = { .fd = G_WIN32_MSG_HANDLE, .events = G_IO_IN };
>    g_poll(fds, 1, timeout);

Ah. Yeah good point.

Ok, I'll respin the series without this patch then.

Thanks,
Alistair

>
> Thanks,
>
> Paolo
>



reply via email to

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