qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Michael Roth <mdroth@linux.vnet.ibm.com>
To: Stefan Hajnoczi <stefanha@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 3/4] sockets: add AF_VSOCK support
Date: Fri, 07 Oct 2016 11:42:35 -0500	[thread overview]
Message-ID: <20161007164235.9563.23850@loki> (raw)
In-Reply-To: <1475772018-27484-4-git-send-email-stefanha@redhat.com>

Quoting Stefan Hajnoczi (2016-10-06 11:40:17)
> 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 seasy 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>
> ---
>  qapi-schema.json    |  23 +++++-
>  util/qemu-sockets.c | 222 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 244 insertions(+), 1 deletion(-)
> 
> diff --git a/qapi-schema.json b/qapi-schema.json
> index c3dcf11..8864a96 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -987,12 +987,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
> @@ -3017,6 +3019,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' } }

Is there any reason to not define these as uint32_t? Not sure if there
are other reasons for this, but if it's just for consistency with how
Inet is handled, the code seems to do straight atoi()<->printf("%d") to
covert between numerical and string representation so it doesn't seem
like we need to account for any differences between command-line and
internal representation in sockaddr_vm.

  parent reply	other threads:[~2016-10-07 16:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-06 16:40 [Qemu-devel] [PATCH 0/4] qga: add vsock-listen Stefan Hajnoczi
2016-10-06 16:40 ` [Qemu-devel] [PATCH 1/4] qga: drop unused sockaddr in accept(2) call Stefan Hajnoczi
2016-10-07 16:01   ` Michael Roth
2016-10-06 16:40 ` [Qemu-devel] [PATCH 2/4] qga: drop unnecessary GA_CHANNEL_UNIX_LISTEN checks Stefan Hajnoczi
2016-10-07 16:04   ` Michael Roth
2016-10-06 16:40 ` [Qemu-devel] [PATCH 3/4] sockets: add AF_VSOCK support Stefan Hajnoczi
2016-10-06 18:14   ` Eric Blake
2016-10-07 12:21     ` Stefan Hajnoczi
2016-10-07 16:42   ` Michael Roth [this message]
2016-10-12 15:06     ` Stefan Hajnoczi
2016-10-13 20:20       ` Michael Roth
2016-10-06 16:40 ` [Qemu-devel] [PATCH 4/4] qga: add vsock-listen method Stefan Hajnoczi
2016-10-07 17:07   ` Michael Roth
2016-10-12 15:07     ` Stefan Hajnoczi
2016-10-13 20:29       ` Michael Roth

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=20161007164235.9563.23850@loki \
    --to=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /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).