> On Apr 23, 2021, at 11:16, Daniel P. Berrangé <berra...@redhat.com> wrote:
>
> On Fri, Apr 23, 2021 at 08:56:48AM +0200, Ralph Schmieder wrote:
>> Hey... new to this list. I was looking for a way to use Unix domain
>> sockets as a network transport between local VMs.
>>
>> I'm part of a team where we run dozens if not hundreds of VMs on a single
>> compute instance which are highly interconnected.
>>
>> In the current implementation, I use UDP sockets (e.g. something like
>>
>> -netdev id=bla,type=socket,udp=localhost:1234,localaddr=localhost:5678)
>>
>> which works great.
>>
>> The downside of this approach is that I need to keep track of all the UDP
>> ports in use and that there's a potential for clashes. Clearly, having Unix
>> domain sockets where I could store the sockets in the VM's directory would
>> be much easier to manage.
>>
>> However, even though there is some AF_UNIX support in net/socket.c, it's
>>
>> - not configurable
>> - it doesn't work
>>
>> As a side note, I tried to pass in an already open FD, but that didn't work
>> either.
>>
>> So, I added some code which does work for me... e.g.
>>
>> - can specify the socket paths like -netdev
>> id=bla,type=socket,unix=/tmp/in:/tmp/out
>> - it does forward packets between two Qemu instances running back-to-back
>>
>> I'm wondering if this is of interest for the wider community and, if so, how
>> to proceed.
>
> As a general rule, any place in QEMU that supports sockets, ought to
> support all of IPv4, IPv6 and UNIX sockets. Where there are gaps
> it generally just needs someone motivated to provide a patch.
OK, great... The code basically works afaict, so I am wondering if you guys are
OK with the CLI "unix=path1:path2" approach and also whether patches are sent
to this list or whether it's better to open a PR on github/gitlab?
Thanks,
-ralph