Module Qcow_cluster_map
type tA cluster map which describes cluster usage in the file. The cluster map tracks which clusters are free, and which are used, and where the references are.
type move_state=Describes the state of a block move
type reference= Qcow_types.Cluster.t * int
module Move : sig ... endtype move={move : Move.t;state : move_state;}describes the state of an in-progress block move
val string_of_move : move -> string
val set_cluster_state : t -> Qcow_types.Cluster.IntervalSet.t -> cluster_state -> cluster_state -> unitUpdate the state of a cluster
module type MutableSet = sig ... endval zero : tA cluster map for a zero-length disk
val make : free:Qcow_bitmap.t -> refs:reference Qcow_types.Cluster.Map.t -> cache:Qcow_cache.t -> first_movable_cluster:Qcow_types.Cluster.t -> runtime_asserts:bool -> id:string option -> cluster_size:int -> tGiven a set of free clusters, and the first cluster which can be moved (i.e. that isn't fixed header), construct an empty cluster map.
val total_used : t -> int64Return the number of tracked used clusters
val total_free : t -> int64Return the number of tracked free clusters
val resize : t -> Qcow_types.Cluster.t -> unitresize t new_size_clustersis called when the file is to be resized.
val add : t -> reference -> Qcow_types.Cluster.t -> unitadd t ref clustermarksclusteras in-use and notes the reference fromreference.
val remove : t -> Qcow_types.Cluster.t -> unitremove t clustermarksclusteras free and invalidates any reference to it (e.g. in response to a discard)
module Junk : MutableSetClusters which contain arbitrary data
module Erased : MutableSetClusters which have been erased but haven't been flushed yet so can't be safely reallocated.
module Available : MutableSetClusters which are available for reallocation
module Copies : MutableSetClusters which contain copies, as part of a compact
module Roots : MutableSetClusters which have been allocated but not yet placed somewhere reachable from the GC
val wait : t -> unit Lwt.twait twait for some amount of recycling work to become available, e.g.- junk could be created
- available could be used
- a move might require a reference update
val start_moves : t -> Move.t liststart_moves tcalculates the block moves required to compacttand marks the clusters as moving
val moves : t -> move Qcow_types.Cluster.Map.tmoves treturns the state of the current active moves
val set_move_state : t -> Move.t -> move_state -> unitUpdate the state of the given move operation
val is_moving : t -> Qcow_types.Cluster.t -> boolis_moving t clusterreturns true ifclusteris still moving
val cancel_move : t -> Qcow_types.Cluster.t -> unitcancel_move clustercancels any in-progress move of clustercluster. This should be called with the cluster write lock held whenever there has been a change in the contents ofcluster
val find : t -> Qcow_types.Cluster.t -> referencefind t clusterreturns the reference tocluster, or raisesNot_found
val get_last_block : t -> Qcow_types.Cluster.tget_last_block tis the last allocated block int. Note if there are no data blocks this will point to the last header block even though it is immovable.
val is_immovable : t -> Qcow_types.Cluster.t -> boolis_immovable t clusteris true ifclusteris fixed and cannot be moved i.e. it is before the first_movable_cluster i.e. it is part of the fixed (L1) header structure.
val update_references : t -> Qcow_types.Cluster.t Qcow_types.Cluster.Map.t -> unitupdate_references t substupdates the reference table following the given set of substitutions. Any reference to a source block must be updated to the destination block otherwise it will be left pointing to junk. Normally this is guaranteed by the Metadata.Physical.set function, but when compacting we split the operation into phases and copy the block first at the byte level, leaving the map out-of-sync
val to_summary_string : t -> stringto_summary_string treturns a terse printable summary oft
module Debug : sig ... end