~/bend-docscommunity

src/disk/access.bend checks

raw source on the hub · import 0x67452e7bc6132b3fa11a687623945b86/src/disk/access.bend as Access

1 import
import Base

Types

type Use source · line 30 · raw

Data

How an image is opened for each use, as flags for Hvf.disk_open_with: 1 read only, 2 an exclusive lock (else a shared one), 4 a regular file only. A disk the guest writes is opened read-write and locked exclusively, so a second bend-vmm can neither write nor read it (two writers corrupt a qcow2 image at once); a :ro disk only reads, with a shared lock beside other readers; a qcow2 image's backing file, named inside the image, only reads, shared, and must be a regular file (never a device or a FIFO the image points at).

type Spec source · line 55 · raw

Data

A --disk entry: an image path, then options as suffixes in any order: ":ro" (the guest only reads it) and ":nocache" (the host does not keep the image's blocks in its own page cache: the guest caches them already; 8 in the open flags, Access.flags_of). Each suffix counts once.

Definitions

def Access.eperm source · line 10 · raw

U32

def Access.eacces source · line 13 · raw

U32

def Access.erofs source · line 16 · raw

U32

def Access.fallback source · line 19 · raw

@+errno:U32 -> Bool

def Access.flags source · line 35 · raw

@u:Use -> U32

def Access.use source · line 44 · raw

@ro:Bool -> Use

def Access.strip source · line 58 · raw

@+s:String -> @+suffix:String -> String

def Access.spec.go source · line 61 · raw

@fuel:Nat -> @+s:String -> @+ro:Bool -> @+nc:Bool -> Spec

def Access.spec source · line 70 · raw

@+s:String -> Spec

def Spec.path source · line 73 · raw

@+x:Spec -> String

def Spec.ro source · line 78 · raw

@+x:Spec -> Bool

def Spec.nocache source · line 83 · raw

@+x:Spec -> Bool

def Access.spec_path source · line 88 · raw

@+s:String -> String

def Access.spec_ro source · line 91 · raw

@+s:String -> Bool

def Access.spec_nocache source · line 94 · raw

@+s:String -> Bool

def Access.suffixes source · line 98 · raw

@+s:String -> String

The suffixes of an entry, as given back after its path.

def Access.flags_of source · line 103 · raw

@u:Use -> @+nocache:Bool -> U32

The open flags for a use, with 8 for :nocache.