mirage-block

Block signatures and implementations for MirageOS
README

This repo contains generic operations over Mirage BLOCK devices.

Please consult the API documentation.

Example usage

In a top-level like utop:

# #require "io-page.unix";;
# #require "mirage-block";;
# #require "mirage-block-ramdisk";;
# #require "lwt.syntax";;

# lwt t_or_error = Ramdisk.create ~name:"hello" ~size_sectors:1024L ~sector_size:512;;
val t_or_error : [ `Error of Ramdisk.error | `Ok of Ramdisk.t ] = `Ok <abstr>

# let t = Mirage_block.Error.ok_exn t_or_error;;
val t : Ramdisk.t = <abstr>

# let page = Io_page.(to_cstruct (get 1));;
val page : Ramdisk.page_aligned_buffer =
  {Cstruct.buffer = <abstr>; off = 0; len = 4096}

# lwt result_or_error = Ramdisk.read t 0L [ page ];;
val result_or_error : [ `Error of Ramdisk.error | `Ok of unit ] = `Ok ()

# lwt ok_or_error = Mirage_block.sparse_copy (module Ramdisk) t (module Ramdisk) t;;
val ok_or_error :
  [ `Error of [> `Different_sizes | `Is_read_only | `Msg of bytes ]
  | `Ok of unit ] = `Ok ()
Install
Maintainers
Sources
mirage-block-v1.2.0.tbz
md5=429022b9e477e8cd99b5906f073c59f4
Dependencies
mirage-device
>= "1.0.0" & < "2.0.0"
dune
>= "1.0"
ocaml
>= "4.04.2"
Reverse Dependencies
docteur-unix
< "0.0.3"
mirage-types
>= "3.0.0" & < "3.7.1"
qcow
>= "0.8.1" & < "0.11.0"
qcow-tool
< "0.11.0"
tar-mirage
>= "1.1.0" & < "2.0.1"
vhd-format-lwt
< "0.12.1"