package mirage-block

  1. Overview
  2. Docs
Utilities and module definitions for dealing with block devices.

Install

Dune Dependency

Authors

Maintainers

Sources

mirage-block-1.1.0.tbz
sha256=c3bf54aa9eafb31a43d6c51c224b7334425d13e730d67190c01d3c647a01cf83
md5=e0ecf9f8ec64a70e4b514f477c6e7634

Description

This library is primarily useful in the context of a Mirage project.

Tags

org:mirage

Published: 22 May 2017

README

Block implementations for mirage

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 ()

Dependencies (5)

  1. result
  2. mirage-device >= "1.0.0" & < "2.0.0"
  3. jbuilder >= "1.0+beta9"
  4. ocamlfind build
  5. ocaml >= "4.02.0"

Dev Dependencies

None

Used by (8)

  1. docteur-unix < "0.0.3"
  2. mirage-block-lwt >= "1.1.0"
  3. mirage-types >= "3.0.0" & < "3.7.1"
  4. nbd-tool < "6.0.1"
  5. qcow >= "0.8.1" & < "0.11.0"
  6. qcow-tool < "0.11.0"
  7. tar-mirage >= "1.1.0" & < "2.0.1"
  8. vhd-format-lwt < "0.12.1"

Conflicts

None

OCaml

Innovation. Community. Security.