package nbd

  1. Overview
  2. Docs

Module Mirror.MakeSource

Parameters

module Primary : Mirage_block.S
module Secondary : Mirage_block.S

Signature

include Mirage_block.S
Sourcetype nonrec error = private [>
  1. | Mirage_block.error
]
Sourceval pp_error : error Fmt.t
Sourcetype nonrec write_error = private [>
  1. | Mirage_block.write_error
]
Sourceval pp_write_error : write_error Fmt.t
Sourcetype t
Sourceval disconnect : t -> unit Lwt.t
Sourceval get_info : t -> Mirage_block.info Lwt.t
Sourceval read : t -> int64 -> Cstruct.t list -> (unit, error) result Lwt.t
Sourceval write : t -> int64 -> Cstruct.t list -> (unit, write_error) result Lwt.t
Sourceval connect : ?progress_cb:([ `Percent of int | `Complete ] -> unit) -> Primary.t -> Secondary.t -> t Lwt.t

connect ?progress primary secondary creates a block device which performs I/O against primary, while building a mirror of primary on top of secondary in the background. Existing data in secondary will be destroyed.

If ?progress_cb is provided then it will be called on every percentage change in mirror progress.

It is an error if the block size of either primary or secondary is not an integer multiple of the other.

It is an error if primary and secondary have different lengths.

It is an error if secondary is read-only.

Sourceval string_of_error : error -> string