package vchan-unix

  1. Overview
  2. Docs
Xen Vchan implementation

Install

Dune Dependency

Authors

Maintainers

Sources

vchan-v5.0.0.tbz
sha256=c3fca6c6db1890cec35a74c2d6fe5644a69285c460976f2a6c8bd0e6012fa52f
sha512=0e11e90197dcc1552424f99208927bf4a3ade41578320ee89e582b8ad510e206ddcb78c49c5c6c3706bb398bbf778f9713d65c255254b34e5faee850ce0ff34c

Description

Tags

org:mirage

Published: 01 Nov 2019

README

README.md

This is an implementation of the Xen "libvchan" or "vchan" communication protocol in OCaml. It allows fast inter-domain communication using shared memory.

Linux configuration

Make sure your systems are properly configured. You may need to:

sudo modprobe xen-evtchn
sudo modprobe xen-gntdev
sudo modprobe xen-gntalloc
mount -t xenfs xenfs /proc/xen

To use in Linux

To connect as a server to a client with domid 'domid' and using the string 'port' to denote the connection:

open Vchan_lwt_unix

open_server ~domid ~port ()
>>= fun (ic, oc) ->
Lwt_io.write_line oc "hello"
>>= fun () ->
Lwt_io.flush oc
>>= fun () ->
Lwt_io.close ic
>>= fun () ->
Lwt_io.close oc

To connect as a client, replace open_server with open_client.

To use the command-line

On both of your VMs, find their domain ids:

xenstore-read domid

On the domain with domid <server domid>, listen for a single connection from <client domid> on <port>:

xencat -l <client domid> <port>

On the domain with domid <client domid>, connect to <server domid>:

xencat <server domid> <port>

So to transfer a file foo from domid 1 to domid 2:

On domain 2, listen for the connection and retrieve the file:

xencat -l 1 foo > copy-of-foo

On domain 1, transmit the file:

cat foo | xencat 2 foo

Dev Dependencies (1)

  1. ounit with-test

Used by

None

Conflicts

None

OCaml

Innovation. Community. Security.