mirage/ocaml-vchan

Name: ocaml-vchan

Owner: MirageOS

Description: Pure OCaml implementation of the "vchan" shared-memory communication protocol

Created: 2013-08-23 13:40:00.0

Updated: 2017-10-27 19:50:14.0

Pushed: 2018-03-03 00:34:57.0

Homepage: null

Size: 689

Language: OCaml

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Build Status Coverage Status

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:

 modprobe xen-evtchn
 modprobe xen-gntdev
 modprobe xen-gntalloc
t -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:

 Vchan_lwt_unix

_server ~domid ~port ()
fun (ic, oc) ->
io.write_line oc "hello"
fun () ->
io.flush oc
fun () ->
io.close ic
fun () ->
io.close oc

To connect as a client, replace `open_serverwith ``open_client```.

To use the command-line

On both of your VMs, find their domain ids:

tore-read domid

On the domain with domid `<server domid>`, listen for a single connection from

xencat -l

he domain with domid ```<client domid>```, connect to ```<server domid>```:

xencat

o transfer a file ```foo``` from domid 1 to domid 2:

omain 2, listen for the connection and retrieve the file:

xencat -l 1 foo > copy-of-foo

omain 1, transmit the file:

cat foo | xencat 2 foo


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.