linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Jeff Layton <jlayton@redhat.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 0/4] nfs-utils mount: add AF_VSOCK support
Date: Thu, 18 May 2017 13:48:30 +0100	[thread overview]
Message-ID: <20170518124830.GA4155@stefanha-x1.localdomain> (raw)
In-Reply-To: <1495039891.2930.8.camel@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2679 bytes --]

On Wed, May 17, 2017 at 12:51:31PM -0400, Jeff Layton wrote:
> On Fri, 2016-10-07 at 11:01 +0100, Stefan Hajnoczi wrote:
> > The AF_VSOCK address family allows virtual machines to communicate with the
> > hypervisor using a zero-configuration transport.  Both KVM and VMware
> > hypervisors support AF_VSOCK and it was introduced in Linux 3.9.
> > 
> > This patch series adds AF_VSOCK support to mount.nfs(8) and works together with
> > the kernel NFS client patches that I am also posting to
> > linux-nfs@vger.kernel.org.
> > 
> > NFS over AF_VSOCK is useful for file system sharing between a virtual machine
> > and the host.  Due to the zero-configuration nature of AF_VSOCK this is more
> > transparent to the user and more robust than asking the user to set up NFS over
> > TCP/IP.
> > 
> > A file system from the host (hypervisor) can be mounted inside a virtual
> > machine over AF_VSOCK like this:
> > 
> >   (guest)# mount.nfs 2:/export /mnt -v -o clientaddr=3,proto=vsock
> > 
> > The VM's cid (address) is 3 and the hypervisor is 2.
> > 
> 
> Sorry for the long delay, and I may just not have been keeping up. I'd
> like to start taking a look at these patches, but I'm having a hard time
> finding much information about how one would use AF_VSOCK in practice.
> I'd like to understand the general idea a little more before I go
> reviewing code...
> 
> If 2 is always the HV's address, then is that documented somewhere?

Yes, it's always the address for the host.  In
/usr/include/linux/vm_sockets.h:

  /* Use this as the destination CID in an address when referring to the host
   * (any process other than the hypervisor).  VMCI relies on it being 2, but
   * this would be useful for other transports too.
   */

  #define VMADDR_CID_HOST 2

VMCI is VMware's AF_VSOCK transport.  virtio-vsock is the VIRTIO
transport for AF_VSOCK (used by KVM).

> How are guest addresses determined?

Guest addresses are assigned before launching a VM.  They are
re-assigned upon live migration (they have host-wide scope, not
datacenter scope).

KVM (QEMU) virtual machines are typically managed using libvirt.
Libvirt support for AF_VSOCK is currently in development and it will
assign addresses to guests.

> Can different guests talk to each other over vsock?

No, for security reasons this is purely host<->guest.  The protocol is
not routable and guest<->guest communication is forbidden.

> Are there plans to eventually add some sort of name resolution? (It
> might be interesting to put together a NSS module that keeps a list of
> running guest hostnames and their vsock addresses).

Not at this time.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

  reply	other threads:[~2017-05-18 12:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-07 10:01 [PATCH 0/4] nfs-utils mount: add AF_VSOCK support Stefan Hajnoczi
2016-10-07 10:01 ` [PATCH 1/4] mount: don't use IPPROTO_UDP for address resolution Stefan Hajnoczi
2017-05-17 19:39   ` Jeff Layton
2016-10-07 10:01 ` [PATCH 2/4] mount: present AF_VSOCK addresses Stefan Hajnoczi
2016-10-07 10:01 ` [PATCH 3/4] mount: accept AF_VSOCK in nfs_verify_family() Stefan Hajnoczi
2016-10-07 10:01 ` [PATCH 4/4] getport: recognize "vsock" netid Stefan Hajnoczi
2017-01-03 16:37 ` [PATCH 0/4] nfs-utils mount: add AF_VSOCK support Steve Dickson
2017-01-04 13:31   ` Stefan Hajnoczi
2017-05-17 16:51 ` Jeff Layton
2017-05-18 12:48   ` Stefan Hajnoczi [this message]
2017-05-18 14:07     ` Jeff Layton
2017-05-22 12:12       ` Stefan Hajnoczi

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=20170518124830.GA4155@stefanha-x1.localdomain \
    --to=stefanha@redhat.com \
    --cc=jlayton@redhat.com \
    --cc=linux-nfs@vger.kernel.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).