package mirage-block-ramdisk
In-memory block device ("Ramdisk") for Mirage
Install
Dune Dependency
Authors
Maintainers
Sources
v0.3.tar.gz
sha256=d3131b4860f6f7d93cffaf58ae9a182ca68b21958c285cc0710d9d4d6e1e52aa
md5=ab0127760d2e3a2103cd2b3d5089b5e5
Description
This is an implementation of the Mirage V1_LWT.BLOCK
signature
backed by an in-heap Map. This library supports
read
/write
- dynamic
resize
(i.e. device truncation and extension) - sparseness querying
README
mirage-block-ramdisk
A simple in-memory BLOCK device.
Please see the API documentation.
Features
Can be dynamically resized
Supports querying sparseness information
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 ()
Dependencies (9)
- lwt
-
mirage-block-lwt
>= "1.0.0"
-
io-page
< "2.0.0"
- cstruct
- base-bytes
-
topkg
build
-
ocamlbuild
build
-
ocamlfind
build
-
ocaml
>= "4.03.0"
Dev Dependencies (1)
-
alcotest
with-test
Used by (4)
-
mirage-block
< "1.0.0"
-
qcow
!= "0.10.0"
- qcow-format
- qcow-tool
Conflicts
None
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page