src/vmm/control.bend checks
raw source on the hub · import 0x8cced805dd17b3296cb7aabd2fa292bb/src/vmm/control.bend as Control
1 import
import Base
Types
type Cmd source · line 8 · raw
Data
CPauseCmd
CResumeCmd
CStatusCmd
CQuitCmd
CNetCmd
CPowerdownCmd
CSnapshot@path:String -> Cmd
CScreendump@path:String -> Cmd
CType@text:String -> Cmd
CPointer@x:U32 -> @y:U32 -> Cmd
CPointerUsageCmd
CUnknownCmd
CBad@why:String -> Cmd
CStatusJsonCmd
CBalloon@mib:U32 -> Cmd
balloon MiB: the balloon's target (--balloon free-page-reporting).
CBalloonAutoCmd
balloon auto: the automatic balloon takes over again (the default; balloon MiB sets a target by hand and stops it).
CHibernate@path:String -> Cmd
hibernate PATH: the VM pauses and stays paused, and its RAM moves into a file at PATH that guest RAM then maps; the file is removed at once (its space comes back when the next snapshot or the VM's exit lets it go). Disks are not kept: the file is no snapshot to restore.
Definitions
def Ctl.usage source · line 34 · raw
String
def Ctl.pointer_usage source · line 37 · raw
String
def Ctl.pointer.mk source · line 41 · raw
@x:Maybe<&2, U32> -> @y:Maybe<&2, U32> -> Cmd
pointer X Y: two numbers on the tablet's 0..32767 scale.
def Ctl.pointer source · line 48 · raw
@ws:List<&2, String> -> Cmd
def Ctl.balloon_usage source · line 57 · raw
String
balloon MiB: the memory the guest is asked to give to the balloon, 0 to 1048576 MiB (0: give it all back).
def Ctl.balloon source · line 60 · raw
@m:Maybe<&2, U32> -> Cmd
def Ctl.mib_pages source · line 68 · raw
@+mib:U32 -> U32
MiB as 4 KiB pages, and back (rounded down).
def Ctl.pages_mib source · line 71 · raw
@+pages:U32 -> U32
def Ctl.balloon_reply source · line 75 · raw
@+target:U32 -> @+actual:U32 -> String
The balloon's reply: its target and how much is in it now, in MiB.
def Ctl.no_balloon source · line 78 · raw
String
def Ctl.status_json_balloon source · line 83 · raw
@paused:Bool -> @+target:U32 -> @+actual:U32 -> String
status json with a balloon: the state, then the balloon's target and what is in it, in MiB (without one, Ctl.status_json).
def Ctl.status_json_kept source · line 89 · raw
@paused:Bool -> @+target:U32 -> @+actual:U32 -> @+kept:U32 -> String
status json with a balloon and what of it the host still holds: kept_mib is the memory in the balloon the host could not release (pages of 16 KiB blocks the balloon holds only part of).
def Ctl.ram_json source · line 94 · raw
@+resident_kib:U32 -> @+compressed_kib:U32 -> String
status json's guest RAM: what of it the host holds, resident and (macOS) compressed, in MiB from KiB; spliced before the object's closing brace.
def Ctl.with_ram source · line 97 · raw
@+json:String -> @+resident_kib:U32 -> @+compressed_kib:U32 -> String
def Ctl.exit_name source · line 103 · raw
@+b:U32 -> String
An exit bucket's name (host/hvf.c's hvf_exit_bucket): 0..63 an exception's class on Hypervisor.framework, 64 a vtimer, 65 canceled (a kick), 66 + a KVM exit reason, 127 anything else.
def Ctl.exits_go source · line 122 · raw
@ws:List<&2, U32> -> @left:Nat -> String
Hvf.exit_counts' words ([cpu, n, n pairs of (bucket, count)] per vCPU) as JSON: each vCPU opens with "},{" (Ctl.exits_json trims the first).
def Ctl.exits_json source · line 131 · raw
@ws:List<&2, U32> -> String
def Ctl.with_exits source · line 136 · raw
@+json:String -> @ws:List<&2, U32> -> String
status json's exits by vCPU, spliced before the object's closing brace.
def Ctl.needs source · line 140 · raw
@+arg:String -> @c:Cmd -> @why:String -> Cmd
A command that takes an argument, given none: its usage.
def Ctl.status_json source · line 144 · raw
@paused:Bool -> String
status json: the VM's state as one JSON object, for programs.
def Ctl.verb source · line 147 · raw
@+verb:String -> @+arg:String -> Cmd
def Ctl.parse source · line 164 · raw
@line:String -> Cmd
One command line: its first word is the verb, the rest (one space between words) its argument.
def Ctl.chars source · line 169 · raw
@bs:List<&2, U32> -> String
Bytes as characters, one per byte (as host/fs.bend's Fs.chars).
def Ctl.frame.got source · line 176 · raw
@+status:U32 -> @+line:List<&2, U32> -> Maybe<&2, Cmd>
def Ctl.frame source · line 183 · raw
@bs:List<&2, U32> -> Maybe<&2, Cmd>
What the host read from a control client (Hvf.ctl_next): [0, a line's bytes...] is a command (an empty line too: it gets the usage), [1, ...] a line cut short, anything else (no control socket) ends the service.