~/bend-docscommunity

src/vmm/disksnap.bend checks

raw source on the hub · import 0x60ac8ec10d74b6dd53fa983c6826c23f/src/vmm/disksnap.bend as Disksnap

3 imports
import Base
import ../lib/bytes.bend as B
import ./snapfile.bend as Sf

Types

type DiskAt source · line 34 · raw

Data

A writable disk and its place in the --disk list.

type Step source · line 93 · raw

Data

What the host does, step by step.

type ArgsAt source · line 177 · raw

Data

NUL-separated arguments: the one being read (reversed) and those done (reversed).

Definitions

def Dsnap.flag source · line 26 · raw

String

def Dsnap.copy_fallback source · line 30 · raw

Bool

When the file system cannot clone, the host copies the image.

def Dsnap.keep source · line 37 · raw

@skip:Bool -> @d:DiskAt -> @more:List<&1, DiskAt> -> List<&1, DiskAt>

def Dsnap.writable.go source · line 44 · raw

@specs:List<&2, String> -> @+i:U32 -> List<&1, DiskAt>

def Dsnap.writable source · line 52 · raw

@+spec:String -> List<&1, DiskAt>

The writable disks of a --disk value ("a.img,b.img:ro").

def Dsnap.folder source · line 58 · raw

@+path:String -> Bool

A snapshot folder (snapshot DIR/, src/vmm/snapdir.bend): its memory is DIR/memory and its copies DIR/disk<i>, tagged "dir" (the folder is written whole, then renamed: no GEN is needed).

def Dsnap.folder_gen source · line 61 · raw

String

def Dsnap.copy source · line 64 · raw

@+snap:String -> @+gen:String -> @+i:U32 -> String

def Dsnap.tmp source · line 69 · raw

@+path:String -> String

def Dsnap.tagged source · line 73 · raw

@args:List<&1, String> -> @+gen:String -> List<&1, String>

The saved command line, tagged with the copies' GEN.

def Dsnap.gen_of.go source · line 78 · raw

@args:List<&1, String> -> @+found:String -> String

The GEN a saved command line is tagged with ("" when none; the last tag wins).

def Dsnap.gen_of source · line 89 · raw

@args:List<&1, String> -> String

def Dsnap.save.go source · line 98 · raw

@ds:List<&1, DiskAt> -> @+snap:String -> @+gen:String -> List<&1, Step>

def Dsnap.save source · line 108 · raw

@+snap:String -> @+gen:String -> @ds:List<&1, DiskAt> -> List<&1, Step>

1: each writable disk cloned to its copy's temporary name.

def Dsnap.place.go source · line 111 · raw

@ds:List<&1, DiskAt> -> @+snap:String -> @+gen:String -> List<&1, Step>

def Dsnap.place source · line 122 · raw

@+snap:String -> @+gen:String -> @ds:List<&1, DiskAt> -> List<&1, Step>

3: the copies renamed into place (before the snapshot itself).

def Dsnap.drop.go source · line 125 · raw

@ds:List<&1, DiskAt> -> @+snap:String -> @+old:String -> List<&1, Step>

def Dsnap.drop source · line 136 · raw

@+snap:String -> @+old:String -> @+gen:String -> @ds:List<&1, DiskAt> -> List<&1, Step>

4: the copies of the snapshot SNAP held before (tagged old, with its own disks), unless they are this one's.

def Dsnap.restore.go source · line 139 · raw

@ds:List<&1, DiskAt> -> @+snap:String -> @+gen:String -> List<&1, Step>

def Dsnap.restore source · line 150 · raw

@+snap:String -> @+gen:String -> @ds:List<&1, DiskAt> -> List<&1, Step>

Restoring SNAP tagged gen: each disk set back from its copy (none when untagged).

def Dsnap.same source · line 155 · raw

@xs:List<&2, U32> -> @ys:List<&2, U32> -> Bool

Reading an existing snapshot's saved command line (to find its GEN): the 40-byte header (src/vmm/snapfile.bend) says where it is and how long.

def Dsnap.args_len source · line 164 · raw

@+head:List<&2, U32> -> U32

def Dsnap.chars source · line 168 · raw

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

def Dsnap.args.byte source · line 180 · raw

@nul:Bool -> @+b:U32 -> @+st:ArgsAt -> ArgsAt

def Dsnap.args.go source · line 187 · raw

@bs:List<&2, U32> -> @+st:ArgsAt -> ArgsAt

def Dsnap.list1 source · line 194 · raw

@xs:List<&2, String> -> @acc:List<&1, String> -> List<&1, String>

def Dsnap.args.end source · line 201 · raw

@+st:ArgsAt -> List<&1, String>

def Dsnap.args source · line 206 · raw

@+bs:List<&2, U32> -> List<&1, String>

def Dsnap.unsave.go source · line 210 · raw

@ds:List<&1, DiskAt> -> @+snap:String -> @+gen:String -> List<&1, Step>

A snapshot that failed: its copies' temporary files removed.

def Dsnap.unsave source · line 219 · raw

@+snap:String -> @+gen:String -> @ds:List<&1, DiskAt> -> List<&1, Step>