package qcow

  1. Overview
  2. Docs

Parameters

Signature

type t

A cluster recycling engine

val create : base:B.t -> sector_size:int -> cluster_bits:int -> cache:Qcow_cache.t -> locks:Qcow_locks.t -> metadata:Qcow_metadata.t -> runtime_asserts:bool -> t

Initialise a cluster recycler over the given block device

val set_cluster_map : t -> Qcow_cluster_map.t -> unit

Set the associated cluster map (which will be updated on every cluster write)

val start_background_thread : t -> keep_erased:int64 -> ?compact_after_unmaps:int64 -> unit -> unit

Start a background thread which will perform block recycling

allocate t n returns n clusters which are ready for re-use. If there are not enough clusters free then this returns None.

Write zeroes over the specified set of clusters

copy src dst copies the cluster src to dst

val move_all : ?progress_cb:(percent:int -> unit) -> t -> Qcow_cluster_map.Move.t list -> (unit, Qcow_metadata.write_error) Pervasives.result Lwt.t

move_all t mv perform the initial data copy of the move operations mv

val update_references : t -> (int64, Qcow_metadata.write_error) Pervasives.result Lwt.t

update_references t rewrites references to any recently copied and flushed block, returning the number of writes completed.

val flush : t -> (unit, B.write_error) Pervasives.result Lwt.t

Issue a flush to the block device, update internal recycler state.

OCaml

Innovation. Community. Security.