d1a60f4 virfdstream: Drop iohelper in favour of a thread

Authored and Committed by mprivozn 7 years ago
    virfdstream: Drop iohelper in favour of a thread
    
    Currently we use iohelper for virFDStream implementation. This is
    because UNIX I/O can lie sometimes: even though a FD for a
    file/block device is set as unblocking, actual read()/write() can
    block. To avoid this, a pipe is created and one end is kept for
    read/write while the other is handed over to iohelper to
    write/read the data for us. Thus it's iohelper which gets blocked
    and not our event loop.
    
    This approach has two problems:
    1) we are spawning a new process.
    2) any exchange of information between daemon and iohelper can be
    done only through the pipe.
    
    Therefore, iohelper is replaced with an implementation in thread
    which is created just for the stream lifetime. The data are still
    transferred through pipe (for now), but both problems described
    above are solved.
    
    Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
    Reviewed-by: John Ferlan <jferlan@redhat.com>
    
        
file modified
+160 -88
file modified
+0 -1