package vchan

  1. Overview
  2. Docs
Xen Vchan implementation

Install

Dune Dependency

Authors

Maintainers

Sources

vchan-v6.0.0.tbz
sha256=7a6cc89ff8ba7144d6cef3f36722f40deedb3cefff0f7be1b2f3b7b2a2b41747
sha512=0df7879cead12d37d7a16cc21af839fc26ba16532ced69313bb3b153f187e5f4586c8e34d59ee51265500e0f50febc1b8c01f9ba3703ddd18b6851f02f52c43a

Description

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

Tags

org:mirage

Published: 22 Oct 2020

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

Dependencies (12)

  1. cmdliner
  2. sexplib
  3. xenstore_transport >= "1.0.0"
  4. xenstore >= "1.2.2"
  5. mirage-flow >= "2.0.0" & < "4.0.0"
  6. io-page
  7. ppx_cstruct
  8. ppx_sexp_conv
  9. cstruct >= "1.9.0" & < "6.1.0"
  10. lwt >= "2.5.0"
  11. dune
  12. ocaml >= "4.08.0"

Dev Dependencies (2)

  1. io-page-unix with-test
  2. ounit with-test

Used by (6)

  1. conduit-mirage != "3.0.0"
  2. jitsu
  3. mirage-conduit < "2.1.0" | >= "3.0.0"
  4. mirage-http = "2.0.0"
  5. vchan-unix >= "4.0.2" & != "5.0.0" & < "6.0.1"
  6. vchan-xen = "4.0.2" | = "6.0.0"

Conflicts

None