Re: [Libguestfs] Libnbd asynchronous API with epoll

2023-07-09 Thread Richard W.M. Jones
On Sun, Jul 09, 2023 at 11:01:47AM +0100, Richard W.M. Jones wrote: > (Sorry for the late reply, was a bit involved in a qemu bug last week ...) > > On Fri, Jul 07, 2023 at 08:58:50AM +, Tage Johansson wrote: > > On 7/6/2023 7:06 PM, Nir Soffer wrote: > > > > > > - After calling for

Re: [Libguestfs] Libnbd asynchronous API with epoll

2023-07-09 Thread Richard W.M. Jones
(Sorry for the late reply, was a bit involved in a qemu bug last week ...) On Fri, Jul 07, 2023 at 08:58:50AM +, Tage Johansson wrote: > On 7/6/2023 7:06 PM, Nir Soffer wrote: > > > - After calling for example aio_notify_read(3), can I know that the next > reading from the file

Re: [Libguestfs] Libnbd asynchronous API with epoll

2023-07-09 Thread Nir Soffer
On Fri, Jul 7, 2023 at 11:59 AM Tage Johansson wrote: > On 7/6/2023 7:06 PM, Nir Soffer wrote: > > - After calling for example aio_notify_read(3), can I know that the next > reading from the file descriptor would block? > > No, you have to call again aio_get_direction() and poll again until the

Re: [Libguestfs] Libnbd asynchronous API with epoll

2023-07-07 Thread Tage Johansson
On 7/6/2023 7:06 PM, Nir Soffer wrote: - After calling for example aio_notify_read(3), can I know that the next reading from the file descriptor would block? No, you have to call again aio_get_direction() and poll again until the event happens. Well, what I mean is: After calling

Re: [Libguestfs] Libnbd asynchronous API with epoll

2023-07-06 Thread Nir Soffer
On Wed, Jul 5, 2023 at 3:38 PM Tage Johansson wrote: > As part of the Rust bindings for Libnbd, I try to integrate the > asynchronous (aio_*) functions with Tokio > , the most used asynchronous runtime > in Rust. However, in its eventloop, Tokio uses epoll(7)

[Libguestfs] Libnbd asynchronous API with epoll

2023-07-05 Thread Tage Johansson
Hello, As part of the Rust bindings for Libnbd, I try to integrate the asynchronous (aio_*) functions with Tokio , the most used asynchronous runtime in Rust. However, in its eventloop, Tokio uses epoll(7) instead of poll(2) (which is used internally in