package nbd

  1. Overview
  2. Docs

Module Nbd.ClientSource

An NBD client which allows you to connect to remote disks and perform I/O.

include S.CLIENT
include Mirage_block.S with type error = [ Mirage_block.error | `Protocol_error of Nbd.Protocol.Error.t ] and type write_error = [ Mirage_block.write_error | `Protocol_error of Nbd.Protocol.Error.t ]
Sourcetype nonrec error = [
  1. | `Disconnected
  2. | `Protocol_error of Protocol.Error.t
]
Sourceval pp_error : error Fmt.t
Sourcetype nonrec write_error = [
  1. | `Disconnected
  2. | `Is_read_only
  3. | `Protocol_error of Protocol.Error.t
]
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
Sourcetype size = int64

The size of a remote disk

Sourceval list : Channel.channel -> (string list, [ `Policy | `Unsupported ]) result Lwt.t

list channel returns a list of exports known by the server. `Error `Policy means the server has this function disabled deliberately. `Error `Unsupported means the server is old and does not support the query function.

Sourceval negotiate : Channel.channel -> string -> (t * size * Protocol.PerExportFlag.t list) Lwt.t

negotiate channel export takes an already-connected channel, performs the initial protocol negotiation and connects to the named export. Returns disk * remote disk size * flags