aboutsummaryrefslogtreecommitdiff
path: root/linux-user/vm86.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2019-03-11 18:25:05 +0100
committerJason Wang <jasowang@redhat.com>2019-03-29 15:22:18 +0800
commitfdec16e3c2a614e2861f3086b05d444b5d8c3406 (patch)
treed7e824672e5589835bf706e1f9147de4da7aadd9 /linux-user/vm86.c
parenta04d91c701251a9b32b7364ddb48029ba024cb75 (diff)
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 'linux-user/vm86.c')
0 files changed, 0 insertions, 0 deletions