~/bend-docscommunity

host/main.bend relies on unsafe/foreign

raw source on the hub · import 0x51718d1816cd36f20955e9590377c5e5/host/main.bend as Main

49 imports
import Base
import ../src/lib/u64.bend as U
import ../src/lib/bytes.bend as B
import ../src/vmm/abi.bend as V
import ../src/vmm/layout.bend as L
import ../src/vmm/machine.bend as M
import ../src/vmm/snapshot.bend as Snap
import ../src/vmm/snapfile.bend as Sf
import ../src/vmm/control.bend as Ctl
import ../src/dev/pointer.bend as Ptr
import ../src/vmm/cli.bend as Cli
import ../src/vmm/clients.bend as Ck
import ../src/dev/conlog.bend as Cl
import ../src/vmm/opts.bend as Op
import ../src/disk/access.bend as Acc
import ../src/vmm/hostfiles.bend as Hf
import ../src/fs/readonly.bend as Ro
import ../src/fs/meta.bend as Mt
import ../src/vmm/disksnap.bend as Ds
import ../src/virtio/balloon.bend as Bl
import ../src/virtio/balauto.bend as Au
import ../src/vmm/snapdir.bend as Sd
import ../src/vmm/cmds.bend as Cm
import ./api.bend as Api
import ../src/net/limits.bend as Lim
import ../src/net/flush.bend as Fl
import ../src/net/udpflow.bend as Uf
import ../src/net/nat.bend as Nt
import ../src/arm64/psci.bend as Ps
import ../src/arm64/irqroute.bend as Rt
import ../src/disk/pack.bend as Pk
import ../src/virtio/device.bend as D
import ../src/virtio/input.bend as In
import ../src/dev/keymap.bend as Km
import ../src/dev/pflash.bend as Pf
import ../src/dev/escape.bend as Es
import ../src/net/addr.bend as Ad
import ../src/boot/image.bend as I
import ../src/boot/dtb.bend as T
import ./hvf.bend as H
import ./fs.bend as Fs
import ./version.bend as Ver
import ../src/disk/store.bend as St
import ../src/disk/qcow2.bend as Qc
import ../src/x86/layout.bend as X
import ../src/x86/boot.bend as Xb
import ../src/x86/acpi.bend as Xa
import ../src/x86/pio.bend as Xp
import ../src/x86/xexit.bend as Xx

Definitions

def log_err source · line 66 · raw

@msg:String -> IO(Unit)

A VMM message on stderr, after the guest's console output so far.

def log_gated source · line 73 · raw

@drop:Bool -> @+g:U32 -> @msg:String -> IO(Unit)

A VMM message, unless the gate (Hvf.log_gate) dropped it; with a count of the ones dropped before it.

def display_of source · line 81 · raw

@spec:String -> Maybe<&2, 0x51718d1816cd36f20955e9590377c5e5/src/boot/dtb.Display>

"WxH" or "WxH,headless" as a display (src/vmm/cli.bend).

def display_window source · line 86 · raw

@+spec:String -> Maybe<&2, 0x51718d1816cd36f20955e9590377c5e5/src/boot/dtb.Display>

The display to open a window for: none when headless ("WxH,headless": the framebuffer and screendump only, no window to take the host's pointer).

def ram source · line 89 · raw

0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64

def ram_bytes source · line 93 · raw

@mem:U32 -> 0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64

RAM size in bytes for mem MiB.

def err source · line 96 · raw

U32

def die_if source · line 99 · raw

@bad:Bool -> @what:String -> IO(Unit)

def boot_regs source · line 107 · raw

@+cpu:U32 -> @entry:0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64 -> @x0:0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64 -> IO(Unit)

Boot registers: PC at entry, X0 the DTB, EL1h with DAIF masked (0x3c5).

def advance_pc source · line 114 · raw

@cpu:U32 -> IO(U32)

def take.got source · line 118 · raw

@got:Maybe<&1, 0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine> -> IO(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine)

The machine lives in a one-slot channel: take it, handle an exit, put it back.

def take source · line 125 · raw

@mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> IO(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine)

def put source · line 130 · raw

@mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @m:0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine -> IO(Unit)

def flash_cmd source · line 136 · raw

@cmd:0x51718d1816cd36f20955e9590377c5e5/src/vmm/abi.FlashCmd -> IO(U32)

A UEFI flash command on bank 1 (host/hvf.c, Hvf.flash).

def vkey source · line 148 · raw

@+conn:U32 -> U32

A vsock connection's key in the host's socket table (apart from the NAT's).

def irq_route source · line 175 · raw

@m:Maybe<&2, U32> -> @+intid:U32 -> IO(U32)

Routes an SPI before it is raised, when src/arm64/irqroute.bend says to (an SPI raised from a vCPU's exit goes to that vCPU).

def net_slirp source · line 346 · raw

@m:0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine -> 0x51718d1816cd36f20955e9590377c5e5/src/net/nat.Slirp

def net_room source · line 354 · raw

@+m:0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine -> @udp:Bool -> @+conn:U32 -> Bool

Whether a reader may read on: few frames pending for the guest, and (a TCP reader, not udp) its connection queues less than Nt.Slirp.queue_cap bytes for the guest.

def tcp_flusher.reset source · line 476 · raw

@quiet:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+conn:U32 -> IO(Unit)

def net_cmd.evict source · line 534 · raw

@m:Maybe<&2, U32> -> IO(Unit)

A flow closed to make room (src/net/udpflow.bend, Udp.evict).

def resolver.got source · line 543 · raw

@r:Pair(File, Result<&1, &1, Pair(U32, String), String>) -> IO(String)

def resolver.opened source · line 550 · raw

@r:Result<&1, &1, Pair(U32, String), File> -> IO(String)

def resolver source · line 560 · raw

IO(Unit)

The host's resolver, for the guest's DNS server 10.0.2.3 (src/net/addr.bend).

def nat_dns.go source · line 569 · raw

@again:Bool -> IO(U32)

The host address of the guest's destination ip; the resolver is read again first when ip is the DNS server (src/net/addr.bend, Addr.reread).

def nat_dns source · line 579 · raw

@+ip:U32 -> IO(U32)

def resume_vm source · line 683 · raw

IO(U32)

Resumes the vCPUs; a hibernated VM is no longer one (Hvf.hib_mark).

def resume_if source · line 688 · raw

@was_running:Bool -> IO(Unit)

def snap.commit source · line 699 · raw

@path:String -> @plan:Maybe<&2, List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/vmm/snapfile.Piece>> -> IO(U32)

Writes what Hvf.snap_save holds as src/vmm/snapfile.bend lays it out; EFBIG (27) when a loader would refuse the file.

def snap.place source · line 709 · raw

@ok:Bool -> @rc:U32 -> @tmp:String -> @path:String -> IO(U32)

A written snapshot (rc 0) renamed into place.

def snap.rebase.at source · line 721 · raw

@+path:String -> @at:Maybe<&2, 0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64> -> @+private:Bool -> IO(U32)

A snapshot in place (ok): guest RAM maps it from now on, where its plan put RAM (Snapf.rebase says why). A refusal leaves RAM as it was: the snapshot stands either way. (private: a hibernate file, removed at once and this VM's alone, which the next hibernate may update in place: Hvf.hib_update)

def snap.rebase source · line 728 · raw

@ok:Bool -> @+path:String -> @at:Maybe<&2, 0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64> -> IO(U32)

def dsnap.step source · line 737 · raw

@s:0x51718d1816cd36f20955e9590377c5e5/src/vmm/disksnap.Step -> IO(U32)

Disk snapshots (src/vmm/disksnap.bend plans them): the host's steps, in order, until one fails (0, or its errno).

def dsnap.run source · line 748 · raw

@ss:List<&1, 0x51718d1816cd36f20955e9590377c5e5/src/vmm/disksnap.Step> -> @+rc:U32 -> IO(U32)

def dsnap.flush source · line 758 · raw

@n:Nat -> IO(Unit)

Every open image's writes reach the host's disk before it is cloned.

def dsnap.disks source · line 768 · raw

IO(List<&1, 0x51718d1816cd36f20955e9590377c5e5/src/vmm/disksnap.DiskAt>)

This VM's writable disks (its command line's --disk).

def dsnap.old.args source · line 776 · raw

@got:Pair(File, Result<&1, &1, Pair(U32, String), List<&2, U32>>) -> IO(String)

The GEN of the snapshot at a path now ("" when there is none, or it has no disk copies): its saved command line, read with the header's help.

def dsnap.old.head source · line 787 · raw

@got:Pair(File, Result<&1, &1, Pair(U32, String), List<&2, U32>>) -> IO(String)

def dsnap.old.opened source · line 798 · raw

@r:Result<&1, &1, Pair(U32, String), File> -> IO(String)

def dsnap.old source · line 807 · raw

@path:String -> IO(String)

def snap.commit.if source · line 814 · raw

@ok:Bool -> @+rc:U32 -> @path:String -> @plan:Maybe<&2, List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/vmm/snapfile.Piece>> -> IO(U32)

The snapshot written, once every disk was copied (else none, and the copies' error).

def dsnap.after source · line 825 · raw

@ok:Bool -> @+dst:String -> @+old:String -> @+gen:String -> IO(U32)

After a failed snapshot, its copies' temporary files go; after one in place, the copies of the snapshot it replaced.

def reply_rc source · line 917 · raw

@+rc:U32 -> @ok:String -> String

def status_json source · line 943 · raw

@paused:Bool -> @info:Maybe<&2, 0x51718d1816cd36f20955e9590377c5e5/src/virtio/balloon.Bal> -> String

status json, with the balloon's target and count when there is one.

def balloon_reply source · line 950 · raw

@has:Bool -> @info:Maybe<&2, 0x51718d1816cd36f20955e9590377c5e5/src/virtio/balloon.Bal> -> String

def pack_json source · line 991 · raw

@m:Maybe<&2, 0x51718d1816cd36f20955e9590377c5e5/src/disk/pack.Pack> -> String

def display.is_close source · line 1327 · raw

@ev:Event -> Bool

def display.map source · line 1399 · raw

@d:Maybe<&2, 0x51718d1816cd36f20955e9590377c5e5/src/boot/dtb.Display> -> IO(Unit)

Maps the framebuffer when --display asks for one.

def base_devices source · line 1517 · raw

List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind>

Devices, in slot order: virtio-rng, virtio-console (hvc0), virtio-net (the user-mode NAT), then a virtio-blk with --disk and a virtio-9p (tag "share") with --share.

def devices.kind source · line 1521 · raw

@ro:Bool -> @+id:U32 -> @sectors:0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64 -> 0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind

One disk image: "path" (read-write) or "path:ro" (read-only).

def bytes_str source · line 1528 · raw

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

def path_dir source · line 1537 · raw

@+p:String -> String

The directory part of a path ("." for none), and a path relative to it (an absolute one stays as it is).

def path_under source · line 1541 · raw

@+dir:String -> @+name:String -> String

def devices.share.ro source · line 1651 · raw

@ro:Bool -> @+sh:U32 -> IO(U32)

--share DIR[,quota=SIZE][,inodes=N][,tag=NAME][,ro], repeatable (src/vmm/cli.bend; Cli.check refused a malformed one): each share its own 9p device, by its tag; writes past a quota, and creates past an inode cap, fail (src/fs/quota.bend); a read-only share's number carries Ro.bit() (src/fs/readonly.bend), and the host refuses its changes too.

def devices.share.with source · line 1658 · raw

@+dir:String -> @q:0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64 -> @+tag:String -> @+ro:Bool -> @+meta:Bool -> @+inodes:U32 -> IO(0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind)

def devices.share.one source · line 1669 · raw

@o:0x51718d1816cd36f20955e9590377c5e5/src/vmm/cli.ShareOpt -> IO(0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind)

def devices.share.go source · line 1676 · raw

@os:List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/vmm/cli.ShareOpt> -> IO(List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind>)

def devices.share source · line 1686 · raw

@none:Bool -> @+spec:String -> IO(List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind>)

def devices.vsock source · line 1695 · raw

@none:Bool -> @+path:String -> IO(List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind>)

--vsock PATH: a virtio-vsock device (guest CID 3) whose host side is Unix sockets under PATH.

def devices.input source · line 1709 · raw

@none:Bool -> List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind>

A virtio keyboard, always (the power button), and with --display a tablet for the window.

def devices.balloon source · line 1738 · raw

@on:Bool -> @+auto:Bool -> @+pct:U32 -> List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind>

The balloon (on unless --balloon off; a restore has it when its snapshot has it): it goes last, so the other devices keep their slots. (pct: --balloon auto,max=PCT; 0 or 50 is the default cap, half the RAM)

def devices.pack source · line 1746 · raw

@+name:String -> List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind>

--pack NAME: a pack, empty at boot (src/disk/pack.bend); none without it.

def pack_kinds source · line 1750 · raw

@ks:List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind> -> List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind>

A restored machine's pack: the snapshot's, its table included.

def initrd_of source · line 1771 · raw

@present:Bool -> @start:0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64 -> @end:0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64 -> Maybe<&2, 0x51718d1816cd36f20955e9590377c5e5/src/boot/dtb.Initrd>

def place_initrd source · line 1778 · raw

@present:Bool -> @path:String -> @at:0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64 -> IO(U32)

def no_image source · line 1785 · raw

0x51718d1816cd36f20955e9590377c5e5/src/boot/image.ImageInfo

def boot_linux.lay source · line 1789 · raw

@lay:0x51718d1816cd36f20955e9590377c5e5/src/boot/image.Layout -> @o:0x51718d1816cd36f20955e9590377c5e5/src/vmm/opts.Opts -> @+ilen:U32 -> @nslots:Nat -> IO(Pair(0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64, 0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64))

Writes the DTB and the initrd where the layout says; answers (entry, dtb).

def boot_linux.placed source · line 1801 · raw

@placed:Maybe<&2, 0x51718d1816cd36f20955e9590377c5e5/src/boot/image.Layout> -> @o:0x51718d1816cd36f20955e9590377c5e5/src/vmm/opts.Opts -> @ilen:U32 -> @nslots:Nat -> IO(Pair(0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64, 0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64))

def boot_linux source · line 1810 · raw

@+o:0x51718d1816cd36f20955e9590377c5e5/src/vmm/opts.Opts -> @nslots:Nat -> IO(Pair(0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64, 0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64))

Loads the kernel at the start of RAM (text_offset 0, every kernel since 3.17), then places the DTB and initrd after it.

def boot_payload source · line 1824 · raw

@+o:0x51718d1816cd36f20955e9590377c5e5/src/vmm/opts.Opts -> @nslots:Nat -> IO(Pair(0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64, 0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64))

A bare-metal payload runs from the start of RAM, with the DTB 64 MiB in.

def boot_uefi source · line 1838 · raw

@+o:0x51718d1816cd36f20955e9590377c5e5/src/vmm/opts.Opts -> @nslots:Nat -> IO(Pair(0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64, 0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64))

--firmware: UEFI firmware runs in place from flash bank 0 (address 0) and finds the device tree, with the flash banks in it, at the start of RAM, as edk2's ArmVirtQemu expects of QEMU's virt machine.

def boot.kernel source · line 1852 · raw

@payload:Bool -> @o:0x51718d1816cd36f20955e9590377c5e5/src/vmm/opts.Opts -> @nslots:Nat -> IO(Pair(0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64, 0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64))

def boot.go source · line 1859 · raw

@kernel:Bool -> @+o:0x51718d1816cd36f20955e9590377c5e5/src/vmm/opts.Opts -> @nslots:Nat -> IO(Pair(0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64, 0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64))

def boot source · line 1866 · raw

@+o:0x51718d1816cd36f20955e9590377c5e5/src/vmm/opts.Opts -> @nslots:Nat -> IO(Pair(0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64, 0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64))

def stopped.reset source · line 1870 · raw

@reset:Bool -> @+code:U32 -> IO(Unit)

Stop code 1 is a guest reset: start over in a fresh process.

def stopped source · line 1882 · raw

@+code:U32 -> IO(Unit)

def shutdown_ms source · line 1980 · raw

U32

SIGTERM and SIGHUP press the guest's power button and give it shutdown_ms to power off; SIGINT, a second signal, or the time running out stop the VMM at once (exit status 128 + the signal).

def forget_lan source · line 2104 · raw

@ds:List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.Dev> -> List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.Dev>

def forget_net source · line 2113 · raw

@m:0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine -> 0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine

After a restore the host holds nothing: the NAT's connections and the LAN frame it held are gone.

def psci_on source · line 2118 · raw

@m:0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine -> List<&2, Bool>

def restore.flash source · line 2163 · raw

@none:Bool -> @+o:0x51718d1816cd36f20955e9590377c5e5/src/vmm/opts.Opts -> IO(Unit)

A UEFI guest's flash banks come back from the same firmware and variable files; bank 1 stays unmapped when the snapshot caught a flash command.

def restore.flash_mode source · line 2174 · raw

@m:Maybe<&2, 0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine> -> IO(U32)

def kinds_words source · line 2182 · raw

@ks:List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind> -> List<&2, U32>

The devices of a machine, as their snapshot words (Snap's Enc.kind).

def devs_kinds source · line 2189 · raw

@ds:List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.Dev> -> List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind>

def has_balloon source · line 2196 · raw

@ks:List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind> -> Bool

def has_auto_balloon source · line 2203 · raw

@ks:List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind> -> Bool

def balloon_pct source · line 2211 · raw

@ks:List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind> -> U32

The automatic balloon's cap in a snapshot's devices (50: the default).

def machine_kinds source · line 2218 · raw

@m:Maybe<&2, 0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine> -> List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind>

def words_eq source · line 2225 · raw

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

def snap.bad source · line 2236 · raw

IO(0x51718d1816cd36f20955e9590377c5e5/src/vmm/snapfile.Layout)

Reading a snapshot's layout (src/vmm/snapfile.bend): the header, then each length prefix where Snapf.need says, then the parts the layout names.

def snap.load source · line 2239 · raw

@fits:Bool -> @+l:0x51718d1816cd36f20955e9590377c5e5/src/vmm/snapfile.Layout -> IO(0x51718d1816cd36f20955e9590377c5e5/src/vmm/snapfile.Layout)

def snap.next source · line 2250 · raw

@full:Bool -> @+h:0x51718d1816cd36f20955e9590377c5e5/src/vmm/snapfile.Head -> @+lens:List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64> -> 0x51718d1816cd36f20955e9590377c5e5/src/vmm/snapfile.Need

The next step once a length prefix is read: a short read is a bad file.

def snap.walk source · line 2259 · raw

@fuel:Nat -> @need:0x51718d1816cd36f20955e9590377c5e5/src/vmm/snapfile.Need -> @+h:0x51718d1816cd36f20955e9590377c5e5/src/vmm/snapfile.Head -> @+lens:List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64> -> @+size:0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64 -> IO(0x51718d1816cd36f20955e9590377c5e5/src/vmm/snapfile.Layout)

fuel: the header's length prefixes (words, GIC, at most 64 vCPUs) and one more step. One def, recursing on fuel only: no @unsafe, no forward calls.

def snap.start source · line 2275 · raw

@h:Maybe<&2, 0x51718d1816cd36f20955e9590377c5e5/src/vmm/snapfile.Head> -> @+size:0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64 -> IO(0x51718d1816cd36f20955e9590377c5e5/src/vmm/snapfile.Layout)

def x86.take.got source · line 2327 · raw

@got:Maybe<&1, 0x51718d1816cd36f20955e9590377c5e5/src/x86/pio.Pio> -> IO(0x51718d1816cd36f20955e9590377c5e5/src/x86/pio.Pio)

def x86.take source · line 2334 · raw

@pc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/x86/pio.Pio) -> IO(0x51718d1816cd36f20955e9590377c5e5/src/x86/pio.Pio)

def x86.put source · line 2339 · raw

@pc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/x86/pio.Pio) -> @p:0x51718d1816cd36f20955e9590377c5e5/src/x86/pio.Pio -> IO(Unit)

def x86.keep source · line 2371 · raw

@same:Bool -> @+p:0x51718d1816cd36f20955e9590377c5e5/src/x86/pio.Pio -> IO(Unit)

The port machine's state, for the next snapshot: handed to the host when it changed (a write to the UART's settings, console input; not each byte sent).

def x86.vcpus source · line 2494 · raw

@n:Nat -> @+cpu:U32 -> IO(U32)

def x86.boot.placed source · line 2505 · raw

@lay:Maybe<&2, 0x51718d1816cd36f20955e9590377c5e5/src/x86/boot.BzLayout> -> @+info:0x51718d1816cd36f20955e9590377c5e5/src/x86/boot.BzInfo -> @+head:List<&2, U32> -> @o:0x51718d1816cd36f20955e9590377c5e5/src/vmm/opts.Opts -> @+nslots:U32 -> IO(U32)

Loads the bzImage, the initrd and the boot structures; starts every vCPU.

def x86.boot.parsed source · line 2527 · raw

@info:Maybe<&2, 0x51718d1816cd36f20955e9590377c5e5/src/x86/boot.BzInfo> -> @+head:List<&2, U32> -> @+o:0x51718d1816cd36f20955e9590377c5e5/src/vmm/opts.Opts -> @+flen:U32 -> @+ilen:U32 -> @+nslots:U32 -> IO(U32)

def x86.initrd source · line 2534 · raw

@o:0x51718d1816cd36f20955e9590377c5e5/src/vmm/opts.Opts -> String

def x86.unsupported source · line 2540 · raw

@o:0x51718d1816cd36f20955e9590377c5e5/src/vmm/opts.Opts -> String

What x86_64 does not have yet: UEFI, a bare-metal payload, a display.

def usage source · line 2666 · raw

String

def main.info.pick source · line 2690 · raw

@+first:String -> Maybe<&2, String>

def main.info source · line 2695 · raw

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

The first argument asks for the version or the usage (so does none).

def console_log.renames source · line 2706 · raw

@ms:List<&1, 0x51718d1816cd36f20955e9590377c5e5/src/dev/conlog.Rename> -> IO(Unit)

--console-log PATH,max=SIZE[,keep=N]: the guest's console goes to PATH, which rotates once it holds max bytes (src/dev/conlog.bend decides, looking every 250 ms: it may pass max by what the guest prints meanwhile). A rotation: Bend's renames (Log.moves), then a new log.

def console_log.rotate source · line 2719 · raw

@go:Bool -> @+path:String -> @keep:U32 -> IO(Unit)

def args_bytes source · line 2756 · raw

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

Arguments as the host keeps them: each one's bytes, then a 0.

Unsafe

unsafe lan_send.each source · line 153 · raw

@names:List<&1, String> -> @+ws:List<&2, U32> -> IO(Unit)

A frame onto the LAN: to the VM of MAC dst, or ([]) to every other VM there (src/vmm/hostfiles.bend names their sockets).

unsafe lan_send source · line 162 · raw

@all:Bool -> @+dst:List<&2, U32> -> @+ws:List<&2, U32> -> IO(Unit)

unsafe interp source · line 186 · raw

@+cpu:U32 -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @-A:Type -> @m:0x51718d1816cd36f20955e9590377c5e5/src/vmm/abi.Vm<A> -> IO(A)

Runs the Vm program of an exit of vCPU cpu (Rt.Route.none(): of the host's own events, outside any vCPU exit). VmCpuOn starts that vCPU's loop, which is defined below (hence @unsafe: the two recurse into each other).

unsafe net_deliver source · line 340 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @ev:0x51718d1816cd36f20955e9590377c5e5/src/vmm/abi.NetEvent -> IO(Unit)

Host network: the NAT's commands run on host sockets; what the sockets report comes back as NetEvents, each delivered by a task of its own (the machine is held while a Vm program runs, so delivery must wait its turn).

unsafe net_wait source · line 360 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+udp:Bool -> @+conn:U32 -> @+ms:U32 -> IO(Unit)

Backpressure: the link to the guest must stay lossless, so a reader waits as long as net_room says no (looking again after 2 ms, then less often, at least every 16 ms); it never reads on regardless.

unsafe net_wait.go source · line 366 · raw

@ok:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+udp:Bool -> @+conn:U32 -> @+ms:U32 -> IO(Unit)

unsafe tcp_reader.got source · line 375 · raw

@eof:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+conn:U32 -> @bs:List<&2, U32> -> IO(Unit)

unsafe tcp_reader.small source · line 385 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+conn:U32 -> IO(Unit)

unsafe tcp_reader.held source · line 390 · raw

@eof:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+conn:U32 -> @n:U32 -> IO(Unit)

unsafe tcp_reader.mode source · line 399 · raw

@big:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+conn:U32 -> IO(Unit)

unsafe tcp_reader source · line 412 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+conn:U32 -> IO(Unit)

A connection's reader. A guest that takes 64 KiB segments gets the host's data as V.TcpReady: up to 65495 bytes held on the host, moved into guest memory when delivered (Hvf.tcp_fill waits for that before it reads more). Otherwise the bytes go through the NAT as V.TcpData.

unsafe tcp_task.connected source · line 418 · raw

@ok:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+conn:U32 -> IO(Unit)

unsafe tcp_task source · line 429 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+conn:U32 -> IO(Unit)

unsafe tcp_flusher.act source · line 439 · raw

@a:0x51718d1816cd36f20955e9590377c5e5/src/net/flush.Act -> @+blocked:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+conn:U32 -> IO(Unit)

A NAT connection's flusher: the host sends the guest's pending data as the socket takes it and answers what it sees (Hvf.tcp_flush); the flusher decides (src/net/flush.bend) and tells the NAT when the pending data blocks or unblocks it, or when the connection was reset. blocked: the NAT was told TcpBlocked; park: wait for the socket before looking again.

unsafe tcp_flusher.again source · line 469 · raw

@more:Bool -> @+blocked:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+conn:U32 -> IO(Unit)

Guest data arrived between the facts and the end: the flusher goes on.

unsafe tcp_flusher.saw source · line 483 · raw

@f:Maybe<&2, 0x51718d1816cd36f20955e9590377c5e5/src/net/flush.Facts> -> @+blocked:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+conn:U32 -> IO(Unit)

unsafe tcp_flusher source · line 490 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+conn:U32 -> @+blocked:Bool -> @park:U32 -> IO(Unit)

unsafe udp_task.idle source · line 499 · raw

@close:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+flow:U32 -> @+sport:U32 -> IO(Unit)

A UDP flow's receiver (flow: its number, Hvf.udp_send): datagrams for guest port sport, as the guest's frames leave room; it ends when the flow closes. The host says the flow went idle: src/net/udpflow.bend decides it closes.

unsafe udp_task.got source · line 508 · raw

@stop:Bool -> @idle:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+flow:U32 -> @+sport:U32 -> @+ws:List<&2, U32> -> IO(Unit)

unsafe udp_task source · line 521 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+flow:U32 -> @+sport:U32 -> IO(Unit)

unsafe net_cmd.connect source · line 526 · raw

@ok:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+conn:U32 -> IO(Unit)

unsafe net_cmd.udp source · line 583 · raw

@fresh:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+flow:U32 -> @+sport:U32 -> IO(Unit)

unsafe net_cmd.sent source · line 595 · raw

@flush:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+conn:U32 -> IO(Unit)

Guest data the socket did not take at once waits on the host: a flusher starts when the send says so.

unsafe net_cmd source · line 602 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @cmd:0x51718d1816cd36f20955e9590377c5e5/src/vmm/abi.NetCmd -> IO(Unit)

unsafe wait_stopped source · line 658 · raw

@fuel:Nat -> IO(Unit)

Waits until no vCPU is inside the guest (they stop at the pause gate).

unsafe wait_stopped.go source · line 667 · raw

@done:Bool -> @fuel:Nat -> IO(Unit)

unsafe pause_vm source · line 676 · raw

IO(U32)

unsafe snapshot source · line 840 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+path:String -> IO(U32)

Pauses (if running), writes the snapshot while holding the machine, and resumes if it was running. Each writable disk is kept with it (src/vmm/disksnap.bend): copied first, its GEN in the saved command line, the copies placed before the snapshot. Answers 0 or an errno.

unsafe hibernate.write source · line 890 · raw

@+m:0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine -> @+path:String -> IO(U32)

A new hibernate file (when the last one could not be updated in place, Hvf.hib_update): the machine and RAM written to path as a snapshot is written, without disk copies (the disks go on with the VM: the file is no snapshot to restore), and guest RAM maps it from then on. Answers 0 or an errno.

unsafe hibernate source · line 907 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+path:String -> IO(U32)

hibernate PATH: pauses (if running) and stays paused, and the VM's RAM leaves the host's memory into a file guest RAM maps. When RAM maps the last hibernate's file still, the pages written since go into it in place (Hvf.hib_update: Linux, on any file system); else a new file at PATH (macOS: a clone of the last one with only what changed written). resume continues the VM. Answers 0 or an errno.

unsafe display.hid source · line 921 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @ev:0x51718d1816cd36f20955e9590377c5e5/src/virtio/input.Hid -> IO(Unit)

A keyboard or pointer report into the machine (M.Machine.hid).

unsafe type_keys source · line 927 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @evs:List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/virtio/input.Hid> -> IO(Unit)

unsafe power_button source · line 939 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> IO(Unit)

The guest's power button: KEY_POWER (116) pressed and released on the virtio keyboard; a guest that handles it (systemd-logind, acpid) shuts down and powers off.

unsafe pack_check.run source · line 959 · raw

@m:0x51718d1816cd36f20955e9590377c5e5/src/vmm/abi.Vm<String> -> IO(String)

A pack's restore check (Machine.pack_check): it opens files and nothing else, so this runs it before the machine exists.

unsafe pack_check source · line 970 · raw

@m:Maybe<&2, 0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine> -> IO(String)

unsafe command.pack source · line 978 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @prog:(@_:0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine -> 0x51718d1816cd36f20955e9590377c5e5/src/vmm/abi.Vm<0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.PackDone>) -> IO(String)

pack add, pack drop (src/vmm/machine.bend decides; the reply is its).

unsafe command.pack.fin source · line 984 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @r:0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.PackDone -> IO(String)

unsafe command.run source · line 999 · raw

@c:0x51718d1816cd36f20955e9590377c5e5/src/vmm/control.Cmd -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> IO(String)

A control command (src/vmm/control.bend says which a line is), carried out.

unsafe ctl_loop.got source · line 1086 · raw

@got:Maybe<&2, 0x51718d1816cd36f20955e9590377c5e5/src/vmm/control.Cmd> -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> IO(Unit)

unsafe ctl_loop source · line 1096 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> IO(Unit)

unsafe escape.run source · line 1103 · raw

@is_p:Bool -> @is_s:Bool -> @paused:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> IO(Unit)

A console escape: p toggles pause, s snapshots to ./bend-vmm.snap, h prints the keys.

unsafe lan_loop source · line 1125 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> IO(Unit)

vsock: the device's commands run on Unix sockets (host/hvf.c); what the sockets report comes back as VsockEvents, each delivered by its own task. The LAN NIC's receiver: the host holds a frame another VM sent (once the last one is released) and the device copies it into the guest's buffers (VmLanToRam, then LanRelease). Without a LAN it parks for good.

unsafe vs_deliver source · line 1133 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @ev:0x51718d1816cd36f20955e9590377c5e5/src/vmm/abi.VsockEvent -> IO(Unit)

unsafe vs_reader.got source · line 1143 · raw

@eof:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+conn:U32 -> @+n:U32 -> IO(Unit)

A vsock connection's reader: the host holds what the program sent (up to Hvf.tcp_fill's buffer) and the device copies it into the guest's buffers (VmVsToRam); once all of it is out (VsRelease) the host reads again, so the guest's pace holds the program back. EOF or an error ends it.

unsafe vs_reader source · line 1152 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+conn:U32 -> IO(Unit)

unsafe vs_task.connected source · line 1157 · raw

@ok:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+conn:U32 -> IO(Unit)

unsafe vs_task source · line 1168 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+conn:U32 -> IO(Unit)

unsafe vs_connect.go source · line 1173 · raw

@ok:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+conn:U32 -> IO(Unit)

unsafe vs_flusher.act source · line 1185 · raw

@a:0x51718d1816cd36f20955e9590377c5e5/src/net/flush.Act -> @+blocked:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+conn:U32 -> IO(Unit)

A vsock connection's flusher: the host program's socket takes the guest's data when it can (Hvf.nat_send queues the rest, as for the NAT), so a program that stops reading never holds the event loop. While it is behind the guest gets no credit (VsBlocked, VsUnblocked); if it stays stuck past the host's limits the socket is reset and the guest sees the host side end.

unsafe vs_flusher.again source · line 1214 · raw

@more:Bool -> @+blocked:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+conn:U32 -> IO(Unit)

unsafe vs_flusher.reset source · line 1221 · raw

@quiet:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+conn:U32 -> IO(Unit)

unsafe vs_flusher.saw source · line 1228 · raw

@f:Maybe<&2, 0x51718d1816cd36f20955e9590377c5e5/src/net/flush.Facts> -> @+blocked:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+conn:U32 -> IO(Unit)

unsafe vs_flusher source · line 1235 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+conn:U32 -> @+blocked:Bool -> @park:U32 -> IO(Unit)

unsafe vs_sent source · line 1240 · raw

@flush:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+conn:U32 -> IO(Unit)

unsafe vsock_cmd source · line 1248 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @cmd:0x51718d1816cd36f20955e9590377c5e5/src/vmm/abi.VsockCmd -> IO(Unit)

The --vsock base path, kept by the C side (Hvf.vsock_base).

unsafe vs_accept_loop.port source · line 1288 · raw

@p:Maybe<&2, U32> -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> IO(Unit)

Host clients asking for guest ports. The client asked for a guest port (src/vmm/clients.bend reads its line): filed as a connection, which the guest is offered; a bad line closes it.

unsafe vs_accept_loop.filed source · line 1299 · raw

@failed:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+conn:U32 -> @+port:U32 -> IO(Unit)

unsafe vs_accept_loop.got source · line 1308 · raw

@stop:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+ws:List<&2, U32> -> IO(Unit)

unsafe vs_accept_loop source · line 1315 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> IO(Unit)

unsafe display.events source · line 1336 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+w:U32 -> @+h:U32 -> @evs:List<&1, Event> -> IO(Bool)

Each window event as keyboard and tablet reports (src/dev/pointer.bend); closing the window stops the VM.

unsafe display.event source · line 1343 · raw

@close:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+w:U32 -> @+h:U32 -> @ev:Event -> @rest:List<&1, Event> -> IO(Bool)

unsafe display.loop source · line 1354 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+w:U32 -> @+h:U32 -> @win:Window -> IO(Unit)

unsafe display.next source · line 1359 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+w:U32 -> @+h:U32 -> @r:Pair(Window, List<&1, Event>) -> IO(Unit)

unsafe display.again source · line 1366 · raw

@closed:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+w:U32 -> @+h:U32 -> @win:Window -> IO(Unit)

unsafe display.first source · line 1375 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+w:U32 -> @+h:U32 -> @r:Pair(Window, Pair(Image, List<&1, Event>)) -> IO(Unit)

unsafe display.opened source · line 1380 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+w:U32 -> @+h:U32 -> @r:Result<&1, &1, Pair(U32, String), Window> -> IO(Unit)

unsafe display.start source · line 1389 · raw

@d:Maybe<&2, 0x51718d1816cd36f20955e9590377c5e5/src/boot/dtb.Display> -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> IO(Unit)

unsafe input_feed source · line 1415 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @bs:List<&2, U32> -> @+tries:U32 -> IO(Unit)

Bytes typed on the host console go to the UART: this loop parks on stdin and hands each chunk to the machine. An idle guest may never exit (the GIC and timer live in Hypervisor.framework), so input cannot wait for exits. Pasted or piped input outruns the UART's 32-byte FIFO, so input_feed gives it what fits and the rest as the guest drains it, polling every 2 ms; after tries polls with no room (a guest not reading the UART) the rest goes anyway, and what does not fit is dropped as by the hardware.

unsafe input_key source · line 1431 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @k:0x51718d1816cd36f20955e9590377c5e5/src/dev/escape.Key -> IO(Unit)

A console key (src/dev/escape.bend): bytes for the guest's UART, or an escape's action.

unsafe input_keys source · line 1448 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @ks:List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/dev/escape.Key> -> IO(Unit)

unsafe input_loop.fed source · line 1457 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @r:Pair(0x51718d1816cd36f20955e9590377c5e5/src/dev/escape.Esc, List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/dev/escape.Key>) -> IO(Unit)

unsafe input_loop.go source · line 1464 · raw

@eof:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @bs:List<&2, U32> -> @e:0x51718d1816cd36f20955e9590377c5e5/src/dev/escape.Esc -> IO(Unit)

unsafe input_loop source · line 1471 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @e:0x51718d1816cd36f20955e9590377c5e5/src/dev/escape.Esc -> IO(Unit)

unsafe input_start source · line 1478 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> IO(Unit)

The console: a terminal's Ctrl-A keys act on the VMM; piped input all goes to the guest.

unsafe vcpu_loop source · line 1484 · raw

@+cpu:U32 -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> IO(Unit)

One vCPU: run, hand the exit to the machine, act on the answer, repeat.

unsafe vcpu_loop.ctl source · line 1491 · raw

@+cpu:U32 -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @ctl:0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Control -> IO(Unit)

unsafe vcpu_loop.next source · line 1507 · raw

@+cpu:U32 -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @step:0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Step -> IO(Unit)

unsafe devices.chain source · line 1547 · raw

@fuel:Nat -> @+path:String -> @+id:U32 -> IO(0x51718d1816cd36f20955e9590377c5e5/src/disk/store.Store)

The store an image at path (open as id) gives: a qcow2 image over its backing file's store (none when it names none), or a raw image. fuel bounds the chain.

unsafe devices.chain.layer source · line 1557 · raw

@m:Maybe<&2, 0x51718d1816cd36f20955e9590377c5e5/src/disk/qcow2.Qcow> -> @f:Nat -> @+path:String -> @+id:U32 -> @+head:List<&2, U32> -> IO(0x51718d1816cd36f20955e9590377c5e5/src/disk/store.Store)

unsafe devices.backing source · line 1568 · raw

@fuel:Nat -> @+path:String -> @+id:U32 -> @b:Pair(0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64, U32) -> IO(0x51718d1816cd36f20955e9590377c5e5/src/disk/store.Store)

The store below a qcow2 image: its backing file (name at off, len bytes; relative to the image's directory), or none.

unsafe devices.backing.at source · line 1573 · raw

@none:Bool -> @fuel:Nat -> @+path:String -> @+id:U32 -> @off:0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64 -> @+len:U32 -> IO(0x51718d1816cd36f20955e9590377c5e5/src/disk/store.Store)

unsafe devices.format source · line 1586 · raw

@m:Maybe<&2, 0x51718d1816cd36f20955e9590377c5e5/src/disk/qcow2.Qcow> -> @ro:Bool -> @+path:String -> @+id:U32 -> @+head:List<&2, U32> -> IO(0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind)

A disk image: qcow2 (its header says so) as a store over its backing chain, anything else raw.

unsafe devices.open source · line 1597 · raw

@+ro:Bool -> @+path:String -> @+id:U32 -> IO(0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind)

unsafe devices.retry source · line 1607 · raw

@again:Bool -> @ro:Bool -> @+nc:Bool -> @+path:String -> @+id:U32 -> IO(0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind)

An image the host would not open for writing (src/disk/access.bend says which refusals) is attached read-only, and said so.

unsafe devices.one source · line 1618 · raw

@+spec:String -> IO(0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind)

(src/disk/access.bend reads the entry: its path, :ro, :nocache)

unsafe devices.disks source · line 1628 · raw

@specs:List<&2, String> -> IO(List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind>)

--disk a.img,b.img:ro gives one virtio-blk per image, in order.

unsafe devices.disk source · line 1638 · raw

@none:Bool -> @disk:String -> IO(List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind>)

unsafe devices.lan.go source · line 1718 · raw

@spec:Maybe<&2, 0x51718d1816cd36f20955e9590377c5e5/src/vmm/cli.LanSpec> -> IO(List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind>)

--lan: the LAN NIC (src/vmm/cli.bend reads the spec; Cli.check refused a malformed one), its socket bound in the LAN directory.

unsafe devices.lan source · line 1728 · raw

@none:Bool -> @spec:String -> IO(List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind>)

unsafe devices source · line 1760 · raw

@o:0x51718d1816cd36f20955e9590377c5e5/src/vmm/opts.Opts -> @+balloon:Bool -> @+auto:Bool -> @+pct:U32 -> @+packs:List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind> -> IO(List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind>)

The devices: the pack (packs: none or one) after the disks.

unsafe control source · line 1886 · raw

@none:Bool -> @+path:String -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> IO(Unit)

Starts the control socket when --control names one.

unsafe fwd_timer source · line 1910 · raw

@n:Nat -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+conn:U32 -> IO(Unit)

A forwarded client's SYN timer: every 2 s, while the guest has not answered the NAT's SYN, the NAT is told (it sends the SYN again, and gives up on the third time).

unsafe fwd_timer.go source · line 1921 · raw

@pending:Bool -> @n:Nat -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+conn:U32 -> IO(Unit)

unsafe fwd_client source · line 1930 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+conn:U32 -> @gport:U32 -> IO(Unit)

unsafe fwd_loop.got source · line 1935 · raw

@stop:Bool -> @+idx:U32 -> @+gport:U32 -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+conn:U32 -> IO(Unit)

unsafe fwd_loop source · line 1945 · raw

@+idx:U32 -> @+gport:U32 -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> IO(Unit)

Forward idx's clients, for guest port gport.

unsafe forwards.listened source · line 1950 · raw

@+rc:U32 -> @+idx:U32 -> @+addr:String -> @+hport:U32 -> @+gport:U32 -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> IO(Unit)

unsafe forwards.one source · line 1956 · raw

@m:Maybe<&2, 0x51718d1816cd36f20955e9590377c5e5/src/vmm/cli.Fwd> -> @+idx:U32 -> @spec:String -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> IO(Unit)

unsafe forwards source · line 1968 · raw

@+idx:U32 -> @specs:List<&2, String> -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> IO(Unit)

Listens for every forward (one that cannot listen, its port taken or its address not the host's, stops the VMM) and accepts their clients.

unsafe signals.late source · line 1983 · raw

@+sig:U32 -> @+done:Chan(U32) -> IO(Unit)

unsafe signals.got source · line 1990 · raw

@soft:Bool -> @+sig:U32 -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> IO(Unit)

unsafe signals.on source · line 2003 · raw

@fail:Bool -> @first:Bool -> @+sig:U32 -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> IO(Unit)

unsafe signals source · line 2011 · raw

@first:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> IO(Unit)

unsafe balloon_poll.tick source · line 2022 · raw

@polls:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> IO(Unit)

The clock (src/virtio/balauto.bend): every Auto.period_ms() the host settles the guest RAM it wrote (H.Hvf.ram_settle), and once Auto.start_ms() passed, an automatic balloon's driver is asked for fresh statistics (M.Machine.balloon_poll), which move the balloon's target. Auto.ticks says when it ends: at once on a machine without the automatic balloon where nothing needs settling.

unsafe balloon_poll.on source · line 2032 · raw

@go:Bool -> @+auto:Bool -> @+elapsed:U32 -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> IO(Unit)

unsafe balloon_poll source · line 2044 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> IO(Unit)

unsafe run_machine source · line 2053 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+ctl:String -> @disp:String -> @fwd:String -> @cpus:List<&2, U32> -> IO(Unit)

Runs a machine: the vCPU loops of the given CPUs, console input and the control socket; ends when a vCPU stops the VM.

unsafe spawn_cpus source · line 2069 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @cpus:List<&2, U32> -> IO(Unit)

unsafe start.go source · line 2078 · raw

@cpus:U32 -> @ctl:String -> @disp:String -> @fwd:String -> @kinds:List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind> -> @pc:0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64 -> @dtb:0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64 -> IO(Unit)

unsafe start source · line 2088 · raw

@o:0x51718d1816cd36f20955e9590377c5e5/src/vmm/opts.Opts -> @kinds:List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind> -> @entry:Pair(0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64, 0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64) -> IO(Unit)

unsafe restore_cpus source · line 2125 · raw

@i:U32 -> @saved:List<&2, U32> -> @+on:List<&2, Bool> -> IO(List<&2, U32>)

CPU indexes i (from i0) whose saved flag is set, created now; answers the ones PSCI has on.

unsafe restore_cpu source · line 2137 · raw

@saved:Bool -> @i:U32 -> IO(U32)

unsafe restore.machine source · line 2144 · raw

@got:Maybe<&2, 0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine> -> @+o:0x51718d1816cd36f20955e9590377c5e5/src/vmm/opts.Opts -> @kinds:List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/virtio/device.DevKind> -> IO(Unit)

unsafe restore source · line 2282 · raw

@+path:String -> @+now:0x51718d1816cd36f20955e9590377c5e5/src/vmm/opts.Opts -> IO(Unit)

unsafe x86.loop source · line 2345 · raw

@+cpu:U32 -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+pc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/x86/pio.Pio) -> @+done:Chan(U32) -> IO(Unit)

One x86 vCPU: run, hand the exit to the machine or the port machine.

unsafe x86.loop.ctl source · line 2350 · raw

@+cpu:U32 -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+pc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/x86/pio.Pio) -> @+done:Chan(U32) -> @ctl:0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Control -> IO(Unit)

unsafe x86.loop.mem source · line 2361 · raw

@+cpu:U32 -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+pc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/x86/pio.Pio) -> @+done:Chan(U32) -> @step:0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Step -> IO(Unit)

unsafe x86.loop.io source · line 2380 · raw

@+cpu:U32 -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+pc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/x86/pio.Pio) -> @+done:Chan(U32) -> @step:0x51718d1816cd36f20955e9590377c5e5/src/x86/pio.XStep -> @+before:List<&2, U32> -> IO(Unit)

unsafe x86.loop.exit source · line 2388 · raw

@+cpu:U32 -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+pc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/x86/pio.Pio) -> @+done:Chan(U32) -> @e:0x51718d1816cd36f20955e9590377c5e5/src/x86/xexit.XExit -> IO(Unit)

unsafe x86.spawn source · line 2404 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+pc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/x86/pio.Pio) -> @+done:Chan(U32) -> @n:Nat -> @+cpu:U32 -> IO(Unit)

unsafe x86.feed source · line 2415 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+pc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/x86/pio.Pio) -> @+done:Chan(U32) -> @bs:List<&2, U32> -> @+tries:U32 -> IO(Unit)

Console input on x86: into the 16550's FIFO (as fast as the guest reads it) and to the virtio consoles (the machine's input).

unsafe x86.key source · line 2434 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+pc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/x86/pio.Pio) -> @+done:Chan(U32) -> @k:0x51718d1816cd36f20955e9590377c5e5/src/dev/escape.Key -> IO(Unit)

unsafe x86.keys source · line 2441 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+pc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/x86/pio.Pio) -> @+done:Chan(U32) -> @ks:List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/dev/escape.Key> -> IO(Unit)

unsafe x86.input.fed source · line 2450 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+pc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/x86/pio.Pio) -> @+done:Chan(U32) -> @r:Pair(0x51718d1816cd36f20955e9590377c5e5/src/dev/escape.Esc, List<&2, 0x51718d1816cd36f20955e9590377c5e5/src/dev/escape.Key>) -> IO(Unit)

unsafe x86.input.go source · line 2457 · raw

@eof:Bool -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+pc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/x86/pio.Pio) -> @+done:Chan(U32) -> @bs:List<&2, U32> -> @e:0x51718d1816cd36f20955e9590377c5e5/src/dev/escape.Esc -> IO(Unit)

unsafe x86.input source · line 2464 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+pc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/x86/pio.Pio) -> @+done:Chan(U32) -> @e:0x51718d1816cd36f20955e9590377c5e5/src/dev/escape.Esc -> IO(Unit)

unsafe x86.input_start source · line 2469 · raw

@+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+pc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/x86/pio.Pio) -> @+done:Chan(U32) -> IO(Unit)

unsafe x86.run source · line 2474 · raw

@+cpus:U32 -> @+mc:Chan(0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine) -> @+done:Chan(U32) -> @+ctl:String -> @fwd:String -> @p0:0x51718d1816cd36f20955e9590377c5e5/src/x86/pio.Pio -> IO(Unit)

unsafe x86.boot_fresh source · line 2548 · raw

@+o:0x51718d1816cd36f20955e9590377c5e5/src/vmm/opts.Opts -> IO(Unit)

unsafe boot_fresh.arm source · line 2575 · raw

@+o:0x51718d1816cd36f20955e9590377c5e5/src/vmm/opts.Opts -> IO(Unit)

unsafe boot_fresh.arch source · line 2588 · raw

@x86:Bool -> @+o:0x51718d1816cd36f20955e9590377c5e5/src/vmm/opts.Opts -> IO(Unit)

unsafe boot_fresh source · line 2595 · raw

@+o:0x51718d1816cd36f20955e9590377c5e5/src/vmm/opts.Opts -> IO(Unit)

unsafe x86.restore.machine source · line 2604 · raw

@got:Maybe<&2, 0x51718d1816cd36f20955e9590377c5e5/src/vmm/machine.Machine> -> @+o:0x51718d1816cd36f20955e9590377c5e5/src/vmm/opts.Opts -> IO(Unit)

An x86_64 restore: the VM made as at boot (X86's setup, RAM at 0), RAM mapped from the snapshot, every saved vCPU created (each takes its registers as it is), then the VM's state (the interrupt controllers, the PIT, the clock, the port machine), and the vCPUs run.

unsafe x86.restore source · line 2621 · raw

@+path:String -> @+now:0x51718d1816cd36f20955e9590377c5e5/src/vmm/opts.Opts -> IO(Unit)

unsafe restore.arch source · line 2650 · raw

@x86:Bool -> @+o:0x51718d1816cd36f20955e9590377c5e5/src/vmm/opts.Opts -> IO(Unit)

unsafe main.mode source · line 2657 · raw

@fresh:Bool -> @+o:0x51718d1816cd36f20955e9590377c5e5/src/vmm/opts.Opts -> IO(Unit)

unsafe console_log.loop source · line 2726 · raw

@+path:String -> @+max:0x51718d1816cd36f20955e9590377c5e5/src/lib/u64.U64 -> @+keep:U32 -> IO(Unit)

unsafe console_log source · line 2733 · raw

@spec:Maybe<&2, 0x51718d1816cd36f20955e9590377c5e5/src/vmm/cli.ConLog> -> IO(Unit)

unsafe main.go source · line 2743 · raw

@info:Maybe<&2, String> -> @+args:List<&1, String> -> IO(Unit)

unsafe Vmm.run source · line 2768 · raw

@+prog:List<&1, String> -> @+flags:List<&1, String> -> IO(Unit)

The VMM as a library (one VM per process: the host layer's state is the process's). prog is how this program starts the VMM again, on a guest reset (Hvf.reexec) and in a snapshot's saved command line: ["bend-vmm"], or a caller's ["vk8s", "vmm"]. flags are the VMM's options, as on the command line. Errors end the process (IO.die); so do quit and power off.

unsafe main.cmd source · line 2784 · raw

@none:Bool -> @+prog:List<&1, String> -> @+rest:List<&1, String> -> @s:0x51718d1816cd36f20955e9590377c5e5/src/vmm/cmds.Sub -> IO(Unit)

A command line: a command (bend-vmm create, run, snapshot, restore ...: host/api.bend runs it, Vmm.run its VM) or a VM's options.

unsafe main source · line 2791 · raw

IO(Unit)