From: Ralph Schmieder <ralph.schmieder@gmail.com>
To: qemu-devel@nongnu.org
Subject: socket.c added support for unix domain socket datagram transport
Date: Fri, 23 Apr 2021 08:56:48 +0200 [thread overview]
Message-ID: <1C0E1BC5-904F-46B0-8044-68E43E67BE60@gmail.com> (raw)
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.
Thanks,
-ralph
Commit https://github.com/rschmied/qemu/commit/73f02114e718ec898c7cd8e855d0d5d5d7abe362
next reply other threads:[~2021-04-23 6:58 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-23 6:56 Ralph Schmieder [this message]
2021-04-23 9:16 ` socket.c added support for unix domain socket datagram transport Daniel P. Berrangé
2021-04-23 13:38 ` Ralph Schmieder
2021-04-23 15:29 ` Stefano Brivio
2021-04-23 15:48 ` Ralph Schmieder
2021-04-23 16:39 ` Stefano Brivio
2021-04-26 11:14 ` Ralph Schmieder
2021-04-27 21:51 ` Stefano Brivio
2021-04-23 16:21 ` Daniel P. Berrangé
2021-04-23 16:54 ` Stefano Brivio
2021-04-26 12:05 ` Ralph Schmieder
2021-04-26 12:56 ` Daniel P. Berrangé
2021-04-27 21:52 ` Stefano Brivio
2021-04-28 9:02 ` Daniel P. Berrangé
2021-04-29 12:07 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1C0E1BC5-904F-46B0-8044-68E43E67BE60@gmail.com \
--to=ralph.schmieder@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).