]> git.proxmox.com Git - qemu.git/commit - main-loop.c
main-loop: switch to g_poll() on POSIX hosts
authorStefan Hajnoczi <stefanha@redhat.com>
Wed, 20 Feb 2013 10:28:25 +0000 (11:28 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Thu, 21 Feb 2013 22:17:30 +0000 (16:17 -0600)
commitcbff4b342b000a7642125dbdabf61113e05eee44
tree6243a0867a869baaca82e328da42e5fe98b74da6
parent134a03e0b3d34b01b68107104c525c3bff1211d4
main-loop: switch to g_poll() on POSIX hosts

Use g_poll(3) instead of select(2).  Well, this is kind of a cheat.
It's true that we're now using g_poll(3) on POSIX hosts but the *_fill()
and *_poll() functions are still using rfds/wfds/xfds.

We've set the scene to start converting *_fill() and *_poll() functions
step-by-step until no more rfds/wfds/xfds users remain.  Then we'll drop
the temporary gpollfds_from_select() and gpollfds_to_select() functions
and be left with native g_poll(2).

On Windows things are a little crazy: convert from rfds/wfds/xfds to
GPollFDs, back to rfds/wfds/xfds, call select(2), rfds/wfds/xfds back to
GPollFDs, and finally back to rfds/wfds/xfds again.  This is only
temporary and keeps the Windows build working through the following
patches.  We'll drop this excessive conversion later and be left with a
single GPollFDs -> select(2) -> GPollFDs sequence that allows Windows to
use select(2) while the rest of QEMU only knows about GPollFD.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Message-id: 1361356113-11049-3-git-send-email-stefanha@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
main-loop.c