[libvirt] [PATCH 2/2] qemu: use -incoming fd:n to avoid qemu holding fd indefinitely

Eric Blake eblake at redhat.com
Thu Dec 23 16:34:10 UTC 2010


On 12/23/2010 05:49 AM, Paolo Bonzini wrote:
> On 12/22/2010 11:27 PM, Eric Blake wrote:
>> https://bugzilla.redhat.com/show_bug.cgi?id=620363
>>
>> When using -incoming stdio or -incoming exec:cat, qemu keeps the
>> stdin fd open long after the migration is complete.  Not to
>> mention that exec:cat is horribly inefficient, by doubling the
>> I/O and going through a popen interface in qemu.
>>
>> The new -incoming fd: of qemu 0.12.0 closes the fd after using
>> it, and allows us to bypass an intermediary cat process for
>> less I/O.
>>
>> It would also be possible to fix this bug for qemu<  0.12.0, by
>> creating a dummy 'cat' process that reads from real fd and writes to a
>> pipe, and pass the other end of the pipe into -incoming exec:cat or
>> -incoming stdio, at the expense of even more I/O.  I don't know if
>> that is worth the patch, though.
> 
> Since you are at it, you may also want to replace the usage of netcat
> and Unix sockets with "-incoming fd:" and a one-way pipe.

Not sure it's worth it.  Is unix:path any less efficient than creating a
one-way pipe for use by fd:n?  Also, we can't replace netcat; the use of
'-incoming "exec:nc -lU path"' is only used in libvirt that predates
'-incoming unix:path', which also happens to predate '-incoming fd:n'.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20101223/a090574e/attachment-0001.sig>


More information about the libvir-list mailing list