qemu-devel
[Top][All Lists]
Advanced

[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




reply via email to

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