vmtemplate

command
v0.4.0-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Command vmtemplate is the reference template of the cloudhv backend: the workload the guest init runs in every micro-VM, and the fake VMM runs as its child without one. It speaks the template side of hack/cloudhv/PROTOCOL.md on fd 3 and serves a small line protocol on FIBERD_ENDPOINT, a subset of sdk/c/template/refzygote.c's.

ping            -> pong
incr            -> <n>       (per-fiber counter, survives a park in a real VM)
get             -> <n>
random          -> <n>       (math/rand, reseeded in every incarnation)
getrandom       -> <hex>     (8 bytes from the kernel)
fence           -> <fence>
generation      -> <n>
session         -> the session, or "-"
payload         -> the payload in hex, or "-"
dirty <bytes>   -> ok        (grows the working set, charged as W)
getenv <NAME>   -> value or "-"
engine <line>   -> the engine's one-line reply over vsock
gpufill <seed> <bytes> -> "ok <hash>" once a reserve of bytes under
                  the fence and the engine's fill from seed succeed
gpucheck        -> "ok", "mismatch <kept> <now>", or "err none"
gpuopen <path>  -> "ok" or the errno's name of open(O_RDWR)

The device probes answer as refzygote's do (gpu.go), engine errors passed through. The payload is JSON. "dirty_bytes" grows the fiber right after it serves, which is how conformance case C6 drives a fiber over its W budget, "device_bytes" reserves a slice of the grant's engine then, and "ready_delay_ms" waits before it binds.

Build it static (CGO_ENABLED=0), since the guest's rootfs and the fake VMM's jail hold no libraries.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL