On Thu, Nov 17, 2022 at 02:58:57PM +0100, Stefano Brivio wrote:
On Thu, 17 Nov 2022 12:26:09 +0000 "Richard W.M. Jones"
wrote: Unfortunately I don't think the --fd option is working. stracing the code shows the socket being added to the epoll, but it somehow never gets read. It might be something obvious but I couldn't see what was wrong. (NB: The socket passed in is *connected* already).
I'm looking into this (right now just for something obvious, if nothing pops up, a bit later) but actually I wonder: couldn't qemu() from 5/5 just call socket(AF_UNIX, SOCK_STREAM, 0) and connect() on it? Or am I missing something?
We could create a temporary socket in the filesystem. --fd avoids the overhead of having to connect on one side and listen/accept on the other side, and having something in the filesystem which needs to be cleaned up. (Linux has the anonymous namespace which avoids cleanup but not the rest).
Then sure, as you mentioned, this could be useful for something else, so it's probably worth it to get it working.
Right - we have spent a lot of time adding fd passing to qemu, nbdkit & libnbd just because it's generally useful. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org