~/bend-docscommunity

src/vmm/cli.bend checks

raw source on the hub · import 0x9b8f2c0a3d76a7c0e967cd5ae59d1b06/src/vmm/cli.bend as Cli

4 imports
import Base
import ../boot/dtb.bend as T
import ../net/addr.bend as Ad
import ../lib/u64.bend as U

Types

type LanSpec source · line 69 · raw

Data

--lan DIR[,ip=A.B.C.D/N][,mac=xx:xx:xx:xx:xx:xx] =============================================== The LAN directory (every VM on the LAN names the same one), the NIC's MAC and the address its DHCP answers give. A MAC must be unicast (its first byte even); without one it is 52:54:01 and the address's last three bytes, so a VM keeps it. An address takes a prefix of 1 to 30. One of ip= and mac= is needed.

type LanOpts source · line 121 · raw

Data

Options so far: the MAC, the address and its prefix (0: none), and whether every option parsed.

type ShareSpec source · line 235 · raw

Data

--share DIR[,quota=SIZE]: the shared directory and its quota (0: none).

type ConLog source · line 266 · raw

Data

--console-log PATH,max=SIZE[,keep=N]: the console's file, the size it rotates at, and how many old ones it keeps (1 when not given; at most 99).

type ConOpts source · line 269 · raw

Data

Definitions

def Cli.flags source · line 10 · raw

List<&2, String>

def Cli.known source · line 14 · raw

@+flag:String -> @fs:List<&2, String> -> Bool

def Cli.display.mk source · line 22 · raw

@w:Maybe<&2, U32> -> @h:Maybe<&2, U32> -> Maybe<&2, 0x9b8f2c0a3d76a7c0e967cd5ae59d1b06/src/boot/dtb.Display>

"WxH" as a display; None for anything malformed.

def Cli.display.go source · line 29 · raw

@ws:List<&2, String> -> Maybe<&2, 0x9b8f2c0a3d76a7c0e967cd5ae59d1b06/src/boot/dtb.Display>

def Cli.display.size source · line 36 · raw

@parts:List<&2, String> -> Maybe<&2, 0x9b8f2c0a3d76a7c0e967cd5ae59d1b06/src/boot/dtb.Display>

def Cli.display source · line 44 · raw

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

"WxH" or "WxH,headless" as a display; None for "" or anything malformed.

def Cli.is_some source · line 47 · raw

@m:Maybe<&2, 0x9b8f2c0a3d76a7c0e967cd5ae59d1b06/src/boot/dtb.Display> -> Bool

def Cli.within source · line 54 · raw

@n:Maybe<&2, U32> -> @+lo:U32 -> @+hi:U32 -> Bool

def Cli.hex source · line 72 · raw

@+c:U32 -> Maybe<&2, U32>

def Cli.byte.mk source · line 77 · raw

@a:Maybe<&2, U32> -> @b:Maybe<&2, U32> -> Maybe<&2, U32>

def Cli.byte source · line 84 · raw

@s:String -> Maybe<&2, U32>

def Cli.bytes.cons source · line 91 · raw

@b:Maybe<&2, U32> -> @rest:Maybe<&2, List<&2, U32>> -> Maybe<&2, List<&2, U32>>

def Cli.bytes source · line 98 · raw

@ps:List<&2, String> -> Maybe<&2, List<&2, U32>>

def Cli.mac.check source · line 105 · raw

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

def Cli.mac source · line 113 · raw

@s:String -> Maybe<&2, List<&2, U32>>

xx:xx:xx:xx:xx:xx, unicast.

def Cli.mac_of_ip source · line 116 · raw

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

def Cli.lan.ip.mk source · line 124 · raw

@a:Maybe<&2, U32> -> @p:Maybe<&2, U32> -> @o:LanOpts -> LanOpts

def Cli.lan.ip source · line 131 · raw

@parts:List<&2, String> -> @o:LanOpts -> LanOpts

def Cli.lan.mac source · line 140 · raw

@m:Maybe<&2, List<&2, U32>> -> @o:LanOpts -> LanOpts

def Cli.lan.fail source · line 147 · raw

@l:LanOpts -> LanOpts

def Cli.lan.opt source · line 152 · raw

@+o:String -> @+l:LanOpts -> LanOpts

def Cli.lan.opts source · line 157 · raw

@os:List<&2, String> -> @l:LanOpts -> LanOpts

def Cli.lan.make source · line 164 · raw

@+dir:String -> @l:LanOpts -> Maybe<&2, LanSpec>

def Cli.lan.parts source · line 171 · raw

@ps:List<&2, String> -> Maybe<&2, LanSpec>

def Cli.lan source · line 178 · raw

@spec:String -> Maybe<&2, LanSpec>

def Cli.lan_ok source · line 181 · raw

@m:Maybe<&2, LanSpec> -> Bool

def Cli.u64.times10 source · line 190 · raw

@+x:0x9b8f2c0a3d76a7c0e967cd5ae59d1b06/src/lib/u64.U64 -> 0x9b8f2c0a3d76a7c0e967cd5ae59d1b06/src/lib/u64.U64

Sizes: decimal bytes, or K, M or G (KiB, MiB, GiB) after the number.

def Cli.u64.digit source · line 193 · raw

@+c:U32 -> @acc:Maybe<&2, 0x9b8f2c0a3d76a7c0e967cd5ae59d1b06/src/lib/u64.U64> -> Maybe<&2, 0x9b8f2c0a3d76a7c0e967cd5ae59d1b06/src/lib/u64.U64>

def Cli.u64.digits source · line 200 · raw

@cs:String -> @acc:Maybe<&2, 0x9b8f2c0a3d76a7c0e967cd5ae59d1b06/src/lib/u64.U64> -> Maybe<&2, 0x9b8f2c0a3d76a7c0e967cd5ae59d1b06/src/lib/u64.U64>

def Cli.u64.scale source · line 207 · raw

@m:Maybe<&2, 0x9b8f2c0a3d76a7c0e967cd5ae59d1b06/src/lib/u64.U64> -> @+k:Nat -> Maybe<&2, 0x9b8f2c0a3d76a7c0e967cd5ae59d1b06/src/lib/u64.U64>

def Cli.last source · line 214 · raw

@s:String -> U32

def Cli.size.by source · line 223 · raw

@+s:String -> @+last:U32 -> Maybe<&2, 0x9b8f2c0a3d76a7c0e967cd5ae59d1b06/src/lib/u64.U64>

def Cli.size source · line 231 · raw

@+s:String -> Maybe<&2, 0x9b8f2c0a3d76a7c0e967cd5ae59d1b06/src/lib/u64.U64>

def Cli.share.opt source · line 238 · raw

@+dir:String -> @m:Maybe<&2, 0x9b8f2c0a3d76a7c0e967cd5ae59d1b06/src/lib/u64.U64> -> Maybe<&2, ShareSpec>

def Cli.share.parts source · line 245 · raw

@ps:List<&2, String> -> Maybe<&2, ShareSpec>

def Cli.share source · line 254 · raw

@spec:String -> Maybe<&2, ShareSpec>

def Cli.share_ok source · line 257 · raw

@m:Maybe<&2, ShareSpec> -> Bool

def Cli.con.keep source · line 272 · raw

@m:Maybe<&2, U32> -> @c:ConOpts -> ConOpts

def Cli.con.max source · line 279 · raw

@m:Maybe<&2, 0x9b8f2c0a3d76a7c0e967cd5ae59d1b06/src/lib/u64.U64> -> @c:ConOpts -> ConOpts

def Cli.con.fail source · line 286 · raw

@c:ConOpts -> ConOpts

def Cli.con.opt source · line 291 · raw

@+o:String -> @+c:ConOpts -> ConOpts

def Cli.con.opts source · line 295 · raw

@os:List<&2, String> -> @c:ConOpts -> ConOpts

def Cli.con.make source · line 302 · raw

@+path:String -> @c:ConOpts -> Maybe<&2, ConLog>

def Cli.con.parts source · line 309 · raw

@ps:List<&2, String> -> Maybe<&2, ConLog>

def Cli.conlog source · line 316 · raw

@spec:String -> Maybe<&2, ConLog>

def Cli.conlog_ok source · line 319 · raw

@m:Maybe<&2, ConLog> -> Bool

def Cli.find source · line 327 · raw

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

The last value given for flag in the arguments (flag and value pairs), or "".

def Cli.why source · line 342 · raw

@+flag:String -> @+v:String -> String

What is wrong with one flag and its value ("" when nothing): an unknown flag; --mem other than 1..1048576 MiB (1 TiB, what a snapshot holds); --cpus other than 1..64; a malformed --display.

def Cli.check source · line 353 · raw

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

The first thing wrong with the arguments (flag and value pairs), or "".