[libvirt] [PATCH v2 15/21] utils: Write a maximum of MAX_PIPE_FEED_BYTES into a pipe

Stefan Berger stefanb at linux.ibm.com
Thu Jul 11 10:59:41 UTC 2019


On 7/10/19 4:07 PM, Marc-André Lureau wrote:
> On Wed, Jul 10, 2019 at 10:12 PM Stefan Berger
> <stefanb at linux.vnet.ibm.com> wrote:
>> To avoid blocking on a write on a pipe that the receiving process
>> does not read from, write only MAX_PIPE_FEED_BYTES into the pipe
>> so that we can serve other pipes as well.
> why not simply use non-blocking write?

I had thought I would use non-blocking write, but... If we now have a 
large buffer and a pipe with less capacity and O_NONBLOCK is set, would 
we ever be able to make write progress or always get EAGAIN or 
EWOULDBLOCK? Probably what we would need is O_NONBLOCK combined with a 
small amount of bytes to write, like in this patch.





More information about the libvir-list mailing list