Stefan Hajnoczi <stefa...@redhat.com> writes:

> On Thu, Jan 31, 2013 at 06:56:56AM -0600, Anthony Liguori wrote:
>> Stefan Hajnoczi <stefa...@redhat.com> 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 <stefa...@redhat.com>
>> 
>> 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


Reply via email to