~/bend-docscommunity

src/vmm/control.bend checks

raw source on the hub · import 0xe9825c4430d87f4e4f8bae43f6c7aee3/src/vmm/control.bend as Control

1 import
import Base

Types

type Cmd source · line 8 · raw

Data

Definitions

def Ctl.usage source · line 29 · raw

String

def Ctl.pointer_usage source · line 32 · raw

String

def Ctl.pointer.mk source · line 36 · 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 43 · raw

@ws:List<&2, String> -> Cmd

def Ctl.balloon_usage source · line 52 · 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 55 · raw

@m:Maybe<&2, U32> -> Cmd

def Ctl.mib_pages source · line 63 · raw

@+mib:U32 -> U32

MiB as 4 KiB pages, and back (rounded down).

def Ctl.pages_mib source · line 66 · raw

@+pages:U32 -> U32

def Ctl.balloon_reply source · line 70 · 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 73 · raw

String

def Ctl.status_json_balloon source · line 78 · 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.needs source · line 82 · raw

@+arg:String -> @c:Cmd -> @why:String -> Cmd

A command that takes an argument, given none: its usage.

def Ctl.status_json source · line 86 · raw

@paused:Bool -> String

status json: the VM's state as one JSON object, for programs.

def Ctl.verb source · line 89 · raw

@+verb:String -> @+arg:String -> Cmd

def Ctl.parse source · line 105 · 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 110 · 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 117 · raw

@+status:U32 -> @+line:List<&2, U32> -> Maybe<&2, Cmd>

def Ctl.frame source · line 124 · 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.