Module Qcow_recycler.Make
Parameters
B : Qcow_s.RESIZABLE_BLOCKTime : Mirage_time.S
Signature
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 -> tInitialise a cluster recycler over the given block device
val set_cluster_map : t -> Qcow_cluster_map.t -> unitSet 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 -> unitStart a background thread which will perform block recycling
val allocate : t -> Qcow_types.Cluster.t -> Qcow_types.Cluster.IntervalSet.t optionallocate t nreturnsnclusters which are ready for re-use. If there are not enough clusters free then this returns None.
val erase : t -> Qcow_types.Cluster.IntervalSet.t -> (unit, B.write_error) Stdlib.result Lwt.tWrite zeroes over the specified set of clusters
val copy : t -> Qcow_types.Cluster.t -> Qcow_types.Cluster.t -> (unit, B.write_error) Stdlib.result Lwt.tcopy src dstcopies the clustersrctodst
val move_all : ?progress_cb:(percent:int -> unit) -> t -> Qcow_cluster_map.Move.t list -> (unit, Qcow_metadata.write_error) Stdlib.result Lwt.tmove_all t mvperform the initial data copy of the move operationsmv
val update_references : t -> (int64, Qcow_metadata.write_error) Stdlib.result Lwt.tupdate_references trewrites references to any recently copied and flushed block, returning the number of writes completed.