diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2016-10-14 10:00:55 +0100 |
---|---|---|
committer | Michael Roth <mdroth@linux.vnet.ibm.com> | 2016-10-31 19:49:33 -0500 |
commit | 6a02c8069f6c28ed1251e3fbbdf16e49d2c27ccc (patch) | |
tree | 428aaa097dc544ba45d63a71d9bcfe5a8c23ddb8 /qapi-schema.json | |
parent | f06b2031a31cdd3acf6f61a977e505b8c6b58f73 (diff) | |
download | qemu-6a02c8069f6c28ed1251e3fbbdf16e49d2c27ccc.zip qemu-6a02c8069f6c28ed1251e3fbbdf16e49d2c27ccc.tar.gz qemu-6a02c8069f6c28ed1251e3fbbdf16e49d2c27ccc.tar.bz2 |
sockets: add AF_VSOCK support
Add the AF_VSOCK address family so that qemu-ga will be able to use
virtio-vsock.
The AF_VSOCK address family uses <cid, port> address tuples. The cid is
the unique identifier comparable to an IP address. AF_VSOCK does not
use name resolution so it's easy to convert between struct sockaddr_vm
and strings.
This patch defines a VsockSocketAddress instead of trying to piggy-back
on InetSocketAddress. This is cleaner in the long run since it avoids
lots of IPv4 vs IPv6 vs vsock special casing.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* treat trailing commas as garbage when parsing (Eric Blake)
* add configure check instead of checking AF_VSOCK directly
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'qapi-schema.json')
-rw-r--r-- | qapi-schema.json | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/qapi-schema.json b/qapi-schema.json index 8a7b527..5dc96af 100644 --- a/qapi-schema.json +++ b/qapi-schema.json @@ -1063,12 +1063,14 @@ # # @unix: unix socket # +# @vsock: vsock family (since 2.8) +# # @unknown: otherwise # # Since: 2.1 ## { 'enum': 'NetworkAddressFamily', - 'data': [ 'ipv4', 'ipv6', 'unix', 'unknown' ] } + 'data': [ 'ipv4', 'ipv6', 'unix', 'vsock', 'unknown' ] } ## # @VncBasicInfo @@ -3095,6 +3097,24 @@ 'path': 'str' } } ## +# @VsockSocketAddress +# +# Captures a socket address in the vsock namespace. +# +# @cid: unique host identifier +# @port: port +# +# Note that string types are used to allow for possible future hostname or +# service resolution support. +# +# Since 2.8 +## +{ 'struct': 'VsockSocketAddress', + 'data': { + 'cid': 'str', + 'port': 'str' } } + +## # @SocketAddress # # Captures the address of a socket, which could also be a named file descriptor @@ -3105,6 +3125,7 @@ 'data': { 'inet': 'InetSocketAddress', 'unix': 'UnixSocketAddress', + 'vsock': 'VsockSocketAddress', 'fd': 'String' } } ## |