[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 02/11] poller: add Poller for growable GPollFD a
From: |
Anthony Liguori |
Subject: |
Re: [Qemu-devel] [PATCH 02/11] poller: add Poller for growable GPollFD arrays |
Date: |
Thu, 31 Jan 2013 13:09:41 -0600 |
User-agent: |
Notmuch/0.13.2+93~ged93d79 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) |
Stefan Hajnoczi <address@hidden> writes:
> On Thu, Jan 31, 2013 at 06:56:56AM -0600, Anthony Liguori wrote:
>> Stefan Hajnoczi <address@hidden> writes:
>>
>> > QEMU currently uses select(2)-style rfds/wfds/xfds for file descriptor
>> > event polling. Unfortunately the underlying fd_set type and its macros
>> > (FD_SET()) have a hardcoded maximum for file descriptors. It is
>> > possible to exceed this limit so we need a more scalable event polling
>> > structure.
>> >
>> > Poller is a growable array of GPollFDs that will allow us to use
>> > g_poll(3) instead of select(2) in the future.
>> >
>> > Signed-off-by: Stefan Hajnoczi <address@hidden>
>>
>> How about using a GArray instead?
>
> g_poll(3) needs a contiguous array of GPollFD structs. I can't see how
> GArray can provide that - it seems to only work if you're using
> g_array_*() accessor functions and doesn't give you a contiguous C
> array.
The data member is public and points to the start of the array. So you
can just pass array->data.
Regards,
Anthony Liguori
>
> Stefan
- [Qemu-devel] [PATCH 00/11] main-loop: switch to g_poll(3) on POSIX hosts, Stefan Hajnoczi, 2013/01/31
- [Qemu-devel] [PATCH 03/11] poller: add poller_fill() and poller_poll(), Stefan Hajnoczi, 2013/01/31
- [Qemu-devel] [PATCH 04/11] main-loop: switch to g_poll() on POSIX hosts, Stefan Hajnoczi, 2013/01/31
- [Qemu-devel] [PATCH 05/11] main-loop: switch POSIX glib integration to Poller, Stefan Hajnoczi, 2013/01/31
- [Qemu-devel] [PATCH 07/11] iohandler: switch to Poller, Stefan Hajnoczi, 2013/01/31
- [Qemu-devel] [PATCH 08/11] main-loop: drop rfds/wfds/xfds for good, Stefan Hajnoczi, 2013/01/31
- [Qemu-devel] [PATCH 06/11] slirp: switch to Poller, Stefan Hajnoczi, 2013/01/31
- [Qemu-devel] [PATCH 09/11] aio: extract aio_dispatch() from aio_poll(), Stefan Hajnoczi, 2013/01/31
- [Qemu-devel] [PATCH 10/11] aio: convert aio_poll() to g_poll(3), Stefan Hajnoczi, 2013/01/31
- [Qemu-devel] [PATCH 11/11] aio: support G_IO_HUP and G_IO_ERR, Stefan Hajnoczi, 2013/01/31