Re: [PATCH v2 13/21] utils: Implement function to pass a buffer to send via a fd to virCommand

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/11/19 7:02 AM, Stefan Berger wrote:
On 7/10/19 4:09 PM, Marc-André Lureau wrote:
On Wed, Jul 10, 2019 at 10:12 PM Stefan Berger
<stefanb@xxxxxxxxxxxxxxxxxx> wrote:
Implement virCommandSetSendBuffer() that allows the caller to pass a
file descriptor and buffer to virCommand. virCommand will write the
buffer into the file descriptor. That file descriptor could be the
write end of a pipe or one of the file descriptors of a socketpair.
The other file descriptor should be passed to the launched process to
read the data from.

Only implement the function to allocate memory for send buffers
and to free them later on.

Signed-off-by: Stefan Berger <stefanb@xxxxxxxxxxxxx>
that looks fine,
Reviewed-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>


I may need to modify this patch here to set the file descriptor's O_NONBLOCK flag...


The poll behavior of a pipe is that it gets POLLOUT for as long as there is room  left to write, so we will fill it up in more or less passes through the loop. I don't know how one could find out how much space there is left to write on a pipe so that the loop at least would quiet down after filling it up completely because this seems inefficient....

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux