diff options
| author | Marc-André Lureau | 2019-03-11 18:25:05 +0100 |
|---|---|---|
| committer | Jason Wang | 2019-03-29 08:22:18 +0100 |
| commit | fdec16e3c2a614e2861f3086b05d444b5d8c3406 (patch) | |
| tree | d7e824672e5589835bf706e1f9147de4da7aadd9 /python | |
| parent | Merge remote-tracking branch 'remotes/alistair/tags/pull-device-tree-20190327... (diff) | |
| download | qemu-fdec16e3c2a614e2861f3086b05d444b5d8c3406.tar.gz qemu-fdec16e3c2a614e2861f3086b05d444b5d8c3406.tar.xz qemu-fdec16e3c2a614e2861f3086b05d444b5d8c3406.zip | |
net/socket: learn to talk with a unix dgram socket
-net socket has a fd argument, and may be passed pre-opened sockets.
TCP sockets use framing.
UDP sockets have datagram boundaries.
When given a unix dgram socket, it will be able to read from it, but
will attempt to send on the dgram_dst, which is unset. The other end
will not receive the data.
Let's teach -net socket to recognize a UNIX DGRAM socket, and use the
regular send() command (without dgram_dst).
This makes running slirp out-of-process possible that
way (python pseudo-code):
a, b = socket.socketpair(socket.AF_UNIX, socket.SOCK_DGRAM)
subprocess.Popen('qemu -net socket,fd=%d -net user' % a.fileno(), shell=True)
subprocess.Popen('qemu ... -net nic -net socket,fd=%d' % b.fileno(), shell=True)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'python')
0 files changed, 0 insertions, 0 deletions
