~/bend-docscommunity

src/disk/store.bend checks

raw source on the hub · import 0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/store.bend as Store

5 imports
import Base
import ../lib/u64.bend as U
import ../lib/bytes.bend as B
import ../vmm/abi.bend as V
import ./qcow2.bend as Q

Types

type Store source · line 22 · raw

Data

Definitions

def Iov.take source · line 28 · raw

@xs:List<&2, 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Iov> -> @+n:U32 -> List<&2, 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Iov>

The first n bytes of some pieces of memory.

def Iov.drop source · line 37 · raw

@xs:List<&2, 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Iov> -> @+n:U32 -> List<&2, 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Iov>

The pieces of memory past their first n bytes.

def Store.w source · line 45 · raw

@+ws:List<&2, U32> -> @i:Nat -> U32

def Store.read8 source · line 48 · raw

@-R:Type -> @disk:U32 -> @off:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, 0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64>

def Store.write8 source · line 53 · raw

@-R:Type -> @disk:U32 -> @off:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @v:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Unit>

def Store.lookup.l2 source · line 56 · raw

@-R:Type -> @none:Bool -> @+disk:U32 -> @+q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> @l2:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+off:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, 0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Entry>

def Store.lookup.l1 source · line 65 · raw

@-R:Type -> @past:Bool -> @+disk:U32 -> @+q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> @+off:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, 0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Entry>

def Qcow.l1_size source · line 78 · raw

@q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> U32

def Store.lookup source · line 84 · raw

@-R:Type -> @+disk:U32 -> @+q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> @+off:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, 0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Entry>

What the cluster holding guest offset off is in the image.

def Store.read.entry source · line 89 · raw

@-R:Type -> @e:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Entry -> @+disk:U32 -> @+skip:U32 -> @+a:List<&2, 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Iov> -> @below:0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Unit> -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Unit>

A cluster's part (skip bytes in, the pieces' length) into guest memory, by its entry; below: the read of the same bytes from the store below.

def Store.read.rest source · line 101 · raw

@-R:Type -> @done:Bool -> @more:0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Unit> -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Unit>

more, unless the pieces are done.

def Store.read source · line 110 · raw

@fuel:Nat -> @-R:Type -> @st:Store -> @+off:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+iovs:List<&2, 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Iov> -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Unit>

The bytes from guest offset off on into the pieces of memory. fuel bounds the steps (a cluster at a time, and a layer at a time down the chain).

def Store.copy.entry source · line 135 · raw

@-R:Type -> @e:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Entry -> @+disk:U32 -> @+skip:U32 -> @+n:U32 -> @+dst:U32 -> @+doff:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @below:0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Unit> -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Unit>

A cluster's part into disk dst at doff, by its entry; dst is a fresh cluster (zeros), so zeros take nothing. below: the copy from the store below.

def Store.copy source · line 148 · raw

@fuel:Nat -> @-R:Type -> @st:Store -> @+off:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+len:U32 -> @+dst:U32 -> @+doff:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Unit>

Copies len bytes from guest offset off on (down the chain) into disk dst at doff, a fresh cluster.

def Qcow.rt source · line 166 · raw

@q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64

def Qcow.l1 source · line 171 · raw

@q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64

def Qcow.refbits source · line 176 · raw

@q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> U32

def Store.ref.set source · line 181 · raw

@-R:Type -> @+disk:U32 -> @rb:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @slot:U32 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Bool>

def Store.ref.block source · line 188 · raw

@-R:Type -> @none:Bool -> @+disk:U32 -> @+q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> @+rti:U32 -> @rb:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @slot:U32 -> @self:(@_:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Bool>) -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Bool>

The refcount block for a table entry: when there is none, a new cluster (its address into the table first, then its own count, by self).

def Store.ref.go source · line 200 · raw

@-R:Type -> @ok:Bool -> @f:Nat -> @+disk:U32 -> @+q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> @+h:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @self:(@_:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Bool>) -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Bool>

def Store.ref source · line 215 · raw

@fuel:Nat -> @-R:Type -> @+disk:U32 -> @+q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> @+h:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Bool>

Sets the reference count of the cluster at host offset h to 1 (16-bit counts only; false when the refcount table has no room for it). fuel bounds the new refcount blocks that counting takes.

def Store.window source · line 232 · raw

U32

Allocation, reusing freed clusters (as QEMU does): the host keeps a hint per image, the first host offset that may hold a free cluster (0 at first; a discard lowers it). A new cluster comes from the window of up to Store.window() reference counts at the hint, read at once: the first count of 0 below the image's end is reused (made to read as zeros first: L2 tables and partial writes rely on that), the hint past it; else the hint moves past the window and the cluster is appended (V.Op.disk_alloc). Once the hint is at the end, an allocation costs one host call more. Refcount blocks are still appended.

def Store.first_free source · line 236 · raw

@bs:List<&2, U32> -> @+i:U32 -> @+n:U32 -> U32

The index of the first 16-bit count of 0 among n in bs (n when none).

def Store.alloc.pick source · line 249 · raw

@+i:U32 -> @+n:U32 -> @+h:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+csize:U32 -> @+end:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64

The cluster to take from a window at h (n counts, the block's bytes bs) below end, or none (U64 max).

def Store.alloc.take source · line 253 · raw

@-R:Type -> @found:Bool -> @+disk:U32 -> @+q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> @+c:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+next:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, 0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64>

def Store.alloc.block source · line 267 · raw

@-R:Type -> @none:Bool -> @+disk:U32 -> @+q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> @+rb:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+h:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+end:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+slot:U32 -> @+n:U32 -> @+next:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, 0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64>

The window at h: its refcount block (none: every count there is 0) and up to Store.window() counts, not past the block's end.

def Store.alloc.scan source · line 277 · raw

@-R:Type -> @scan:Bool -> @+disk:U32 -> @+q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> @+h:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+end:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, 0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64>

def Store.alloc source · line 292 · raw

@-R:Type -> @+disk:U32 -> @+q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, 0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64>

A new cluster: a freed one when the window at the hint has one, else one appended. Its count is the caller's to set (Store.ref).

def Store.fill source · line 301 · raw

@-R:Type -> @whole:Bool -> @e:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Entry -> @+disk:U32 -> @+q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> @+nc:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @cow:(@_:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Unit>) -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Unit>

The old contents of a cluster about to move to nc: nothing when the write covers it whole, else by its entry (below: from the store below).

def Store.write.new source · line 318 · raw

@-R:Type -> @e:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Entry -> @+disk:U32 -> @+q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> @slot:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+inner:U32 -> @+n:U32 -> @a:List<&2, 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Iov> -> @cow:(@_:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Unit>) -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Bool>

A write into a cluster that is not the image's alone: a new cluster, its count, the old contents, the data, then the L2 entry at slot.

def Store.write.mapped source · line 327 · raw

@-R:Type -> @copied:Bool -> @+off:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+disk:U32 -> @+q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> @slot:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+inner:U32 -> @+n:U32 -> @a:List<&2, 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Iov> -> @cow:(@_:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Unit>) -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Bool>

def Store.write.entry source · line 336 · raw

@-R:Type -> @e:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Entry -> @+disk:U32 -> @+q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> @slot:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+inner:U32 -> @+n:U32 -> @a:List<&2, 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Iov> -> @cow:(@_:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Unit>) -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Bool>

def Store.write.l2 source · line 343 · raw

@-R:Type -> @fail:Bool -> @+disk:U32 -> @+q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> @l2:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+off:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+inner:U32 -> @+n:U32 -> @a:List<&2, 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Iov> -> @cow:(@_:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Unit>) -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Bool>

def Store.ensure_l2 source · line 354 · raw

@-R:Type -> @none:Bool -> @+disk:U32 -> @+q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> @+l1i:U32 -> @l2:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, 0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64>

The L2 table for L1 entry l1i: a new one (zeros, counted) when none.

def Store.write.cluster.go source · line 365 · raw

@-R:Type -> @past:Bool -> @+disk:U32 -> @+q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> @+off:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+inner:U32 -> @+n:U32 -> @a:List<&2, 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Iov> -> @cow:(@_:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Unit>) -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Bool>

def Store.write.cluster source · line 378 · raw

@-R:Type -> @+disk:U32 -> @+q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> @+off:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+inner:U32 -> @+n:U32 -> @a:List<&2, 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Iov> -> @cow:(@_:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Unit>) -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Bool>

n bytes (the pieces a) at guest offset off, inner bytes into its cluster.

def Store.write.rest source · line 381 · raw

@-R:Type -> @done:Bool -> @more:0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Bool> -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Bool>

def Store.bytes source · line 389 · raw

@-R:Type -> @xs:List<&2, 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Iov> -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, List<&2, U32>>

The bytes of the pieces of memory, read from the guest.

def Store.same source · line 399 · raw

@a:List<&2, U32> -> @b:List<&2, U32> -> Bool

def Store.qcow_magic source · line 409 · raw

@bs:List<&2, U32> -> Bool

Whether bytes begin as a qcow2 image does (QFI\xfb).

def Store.raw.write source · line 412 · raw

@-R:Type -> @refuse:Bool -> @+disk:U32 -> @+off:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+iovs:List<&2, 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Iov> -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Bool>

def Store.raw.at0 source · line 427 · raw

@-R:Type -> @at0:Bool -> @+disk:U32 -> @+off:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+iovs:List<&2, 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Iov> -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Bool>

A raw image never takes a qcow2 header at its start: the host tells the formats apart by that header, so a guest that wrote one would turn its own disk into a qcow2 image at the next start, one whose backing file could name any host file (QEMU refuses the same for a probed raw image). Guest writes come in 512-byte sectors, so a write that reaches the first bytes starts at 0.

def Store.write source · line 439 · raw

@fuel:Nat -> @-R:Type -> @st:Store -> @+off:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+iovs:List<&2, 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Iov> -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Bool>

Writes the pieces of memory at guest offset off into the top image; false when a qcow2 image cannot take them (no room for its counts, or past its L1 table), a raw image would start as a qcow2 one, or there is no image.

def Store.status source · line 463 · raw

@-R:Type -> @st:Store -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, U32>

Whether a host operation on the store's images failed since the last ask (nonzero), clearing it: a request asks once it is done.

def Store.dis.clear source · line 489 · raw

@-R:Type -> @+disk:U32 -> @+q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> @+h:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Unit>

def Store.dis.hint source · line 499 · raw

@-R:Type -> @+disk:U32 -> @+off:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Unit>

A freed cluster lowers the allocation hint to it (Store.alloc).

def Store.dis.unref.at source · line 508 · raw

@-R:Type -> @+disk:U32 -> @+q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> @+h:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+at:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+bs:List<&2, U32> -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Unit>

One reference less to the host cluster at h: its 16-bit count lowered (a count of 0 stays 0); when it reaches 0, the cluster becomes a hole and lowers the allocation hint (Store.alloc may take it again).

def Store.dis.unref source · line 517 · raw

@-R:Type -> @+disk:U32 -> @+q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> @+h:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Unit>

def Store.dis.unrefs source · line 529 · raw

@fuel:Nat -> @-R:Type -> @+disk:U32 -> @+q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> @+c:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+last:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Unit>

The host clusters from c to last (inclusive), one reference less each (fuel: the most clusters; a compressed cluster spans at most two).

def Store.dis.cluster_of source · line 540 · raw

@+q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> @+h:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64

The host cluster holding byte h.

def Store.dis.entry source · line 550 · raw

@-R:Type -> @e:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Entry -> @+disk:U32 -> @+q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> @+slot:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+zv:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Unit>

A guest cluster let go, by its entry, the entry first reading as zeros (zv) so freed data is never mapped: mapped and the image's alone (COPIED): count 0, a hole (as before); mapped and shared (count above 1): one reference less; compressed: one reference less to each host cluster its bytes span (several compressed clusters share host clusters; the last one out frees it).

def Store.dis.l2 source · line 565 · raw

@-R:Type -> @none:Bool -> @+disk:U32 -> @+q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> @+l2:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+c:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+zv:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Unit>

def Store.dis.cluster source · line 575 · raw

@-R:Type -> @past:Bool -> @+disk:U32 -> @+q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> @+c:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+zv:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Unit>

def Store.dis.go source · line 588 · raw

@fuel:Nat -> @-R:Type -> @+disk:U32 -> @+q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> @+c:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+end:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+zv:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Unit>

The clusters from c to end, one at a time (fuel: the most clusters).

def Store.dis.below source · line 598 · raw

@st:Store -> Bool

def Store.dis.qcow source · line 606 · raw

@-R:Type -> @ok:Bool -> @+disk:U32 -> @+q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> @+backed:Bool -> @+off:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+len:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Unit>

The whole clusters of [off, off+len), on an image that allows it.

def Store.dis.version source · line 616 · raw

@-R:Type -> @+disk:U32 -> @+q:0x3c5aa333777d8e9208888ca3a048f4c7/src/disk/qcow2.Qcow -> @+backed:Bool -> @+off:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @+len:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Unit>

def Store.discard source · line 623 · raw

@-R:Type -> @st:Store -> @off:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> @len:0x3c5aa333777d8e9208888ca3a048f4c7/src/lib/u64.U64 -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Unit>

Frees [off, off+len): a hole in a raw image; whole clusters let go in a qcow2 image (above). Discard is advisory: what cannot be freed stays.

def Store.flush source · line 632 · raw

@-R:Type -> @st:Store -> 0x3c5aa333777d8e9208888ca3a048f4c7/src/vmm/abi.Op<R, Unit>