package vchan
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=e44edd2133158ab628c54929f196a6440a25ca103a6af5c624d022a31781b95d
sha512=8507095e49d2c47d3aa71a62a2856dea3bce0607ee3f03cd9c4a7a93b2a0f6b53788ef0345ce1193a10048251f4bd0f6d1af74ba2191682686ec463653b17622
Description
This is an implementation of the Xen "libvchan" or "vchan" communication protocol in OCaml. It allows fast inter-domain communication using shared memory.
README
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/xenTo 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 ocTo 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 domidOn 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-fooOn domain 1, transmit the file:
cat foo | xencat 2 foo
Dependencies (11)
- sexplib
-
xenstore_transport
>= "1.0.0" -
xenstore
>= "1.2.2" -
mirage-flow
>= "2.0.0" & < "4.0.0" - io-page
- ppx_cstruct
- ppx_sexp_conv
-
cstruct
>= "6.0.0" -
lwt
>= "2.5.0" - dune
-
ocaml
>= "4.08.0"
Used by (2)
Conflicts
None