Documentation
¶
Overview ¶
Package manifest defines the internal virtle launch contract.
It owns the JSON schema that Nix emits for virtle, along with the defaulting and validation rules that keep the runtime assumptions consistent. The package also resolves working-directory and runtime-directory paths into the concrete host-side paths that the manager uses for sockets, lock files, volumes, QEMU binaries, and run processes.
Index ¶
- Constants
- func DefaultVirtioFSArgs(socketPath string, source string, id string) []string
- func GuestCommandContext(ctx context.Context, timeout time.Duration) (context.Context, context.CancelFunc)
- func NewTemplateRenderer(providers ...TemplateProvider) (*executor.Renderer, error)
- func TemplateContext(providers ...TemplateProvider) executor.Context
- type BalloonControllerConfig
- type BalloonControllerInput
- type BalloonDevice
- type BalloonInput
- type CPUCount
- type Command
- type Document
- type ForwardPort
- type ForwardTemplateProvider
- type GraphicsInput
- type HostInput
- type HotplugBlock
- type HotplugDevice
- type HotplugForward
- type HotplugInput
- type HotplugKind
- type HotplugNet
- type HotplugVirtioFS
- type Identity
- type ImageInput
- type ImageMountInput
- type KernelInput
- type MachineInput
- type Manifest
- func (m *Manifest) GuestCommandContext(ctx context.Context) (context.Context, context.CancelFunc)
- func (m *Manifest) ResolvedCleanupFiles() ([]string, error)
- func (m *Manifest) ResolvedControlSocketPath() (string, error)
- func (m *Manifest) ResolvedExternalVirtioFSSocketPaths() ([]string, error)
- func (m *Manifest) ResolvedGuestAgentSocketPath() (string, error)
- func (m *Manifest) ResolvedLockPath() string
- func (m *Manifest) ResolvedNotifications() Notifications
- func (m *Manifest) ResolvedPersistenceBaseDir() string
- func (m *Manifest) ResolvedPersistenceDirectories() []string
- func (m *Manifest) ResolvedPersistenceStateDir() string
- func (m *Manifest) ResolvedQEMU() (QEMU, error)
- func (m *Manifest) ResolvedQMPSocketPath() (string, error)
- func (m *Manifest) ResolvedRuns(cid int) ([]ResolvedRun, error)
- func (m *Manifest) ResolvedSSHReadySocketPath() (string, error)
- func (m *Manifest) ResolvedVirtioFSSocketPaths() ([]string, error)
- func (m *Manifest) ResolvedVolumes() []Volume
- func (m *Manifest) ResolvedWriteFiles() []ResolvedWriteFile
- func (m *Manifest) SSHDestination(cid int) string
- func (m *Manifest) SSHRetryDelay(fallback time.Duration) time.Duration
- func (m *Manifest) Validate() error
- type MountEntry
- type MountInput
- type MountsInput
- func (m MountsInput) Image() []ImageMountInput
- func (m MountsInput) MarshalJSON() ([]byte, error)
- func (m MountsInput) NineP() []NinePMountInput
- func (m MountsInput) RequiresPCI() bool
- func (m *MountsInput) UnmarshalJSON(data []byte) error
- func (m *MountsInput) UnmarshalTOML(data any) error
- func (m MountsInput) VirtioFS() []VirtioFSMountInput
- type NetworkInput
- type NinePInput
- type NinePMountInput
- type NotificationTemplateProvider
- type Notifications
- type NotificationsInput
- type Paths
- type Persistence
- type PortEndpoint
- type QEMU
- type QEMUBlockDevice
- type QEMUCPU
- type QEMUConsole
- type QEMUDevices
- type QEMUGraphics
- type QEMUGuestAgent
- type QEMUHotplug
- type QEMUInput
- type QEMUKernel
- type QEMUKnobs
- type QEMUMachine
- type QEMUMemory
- type QEMUMountDevice
- type QEMUNetDevice
- type QEMUNinePShare
- type QEMUQMP
- type QEMURNGDevice
- type QEMUSMP
- type QEMUSSHReady
- type QEMUTemplateProvider
- type QEMUVSOCKDevice
- type QEMUVirtioFSShare
- type RangeInput
- type ResolveOptions
- type ResolvedRun
- type ResolvedWriteFile
- type Run
- type RunInput
- type RunTemplateProvider
- type RuntimeDir
- type RuntimeDirMode
- type SSH
- type SSHInput
- type SSHTemplateProvider
- type TemplateContextFunc
- type TemplateProvider
- type VSock
- type VSockCIDRange
- type VSockInput
- type VirtioFSInput
- type VirtioFSMountInput
- type VirtioFSTemplateProvider
- type Volume
- type Workspace
- type WorkspaceInput
- type WriteFile
- type WriteFileContent
- type WriteFileContentKind
- type WriteFileInput
- type WriteFiles
Constants ¶
const ( KernelSerialOff = "off" KernelSerialPrint = "print" KernelSerialConsole = "console" )
const ( MountTypeVirtioFS = "virtiofs" MountTypeNineP = "9p" MountTypeImage = "image" )
Variables ¶
This section is empty.
Functions ¶
func DefaultVirtioFSArgs ¶
DefaultVirtioFSArgs is the default virtiofsd argument list for a virtiofs hotplug device.
func GuestCommandContext ¶
func GuestCommandContext(ctx context.Context, timeout time.Duration) (context.Context, context.CancelFunc)
GuestCommandContext bounds a guest-agent command with timeout. Zero means the command is bounded only by ctx, which is returned as-is.
func NewTemplateRenderer ¶
func NewTemplateRenderer(providers ...TemplateProvider) (*executor.Renderer, error)
func TemplateContext ¶
func TemplateContext(providers ...TemplateProvider) executor.Context
Types ¶
type BalloonControllerConfig ¶
type BalloonControllerConfig struct {
MinActual units.MiB `json:"minActualMiB" toml:"minActualMiB"`
MaxActual units.MiB `json:"maxActualMiB,omitempty" toml:"maxActualMiB"`
GrowBelowAvailable units.MiB `json:"growBelowAvailableMiB" toml:"growBelowAvailableMiB"`
ReclaimAboveAvailable units.MiB `json:"reclaimAboveAvailableMiB" toml:"reclaimAboveAvailableMiB"`
Step units.MiB `json:"stepMiB,omitempty" toml:"stepMiB"`
PollInterval time.Duration `json:"pollInterval,omitempty" toml:"pollInterval"`
ReclaimHoldoff time.Duration `json:"reclaimHoldoff,omitempty" toml:"reclaimHoldoff"`
}
BalloonControllerConfig configures the automatic balloon controller.
type BalloonControllerInput ¶
type BalloonControllerInput struct {
MinActual units.MiB `json:"min_actual,omitempty" toml:"min_actual" jsonschema:"Minimum guest memory target in MiB."`
MaxActual units.MiB `json:"max_actual,omitempty" toml:"max_actual" jsonschema:"Maximum guest memory target in MiB."`
GrowBelowAvailable units.MiB `` /* 156-byte string literal not displayed */
ReclaimAboveAvailable units.MiB `` /* 165-byte string literal not displayed */
Step units.MiB `json:"step,omitempty" toml:"step" jsonschema:"Memory adjustment step size in MiB."`
PollInterval units.Duration `` /* 138-byte string literal not displayed */
ReclaimHoldoff units.Duration `` /* 145-byte string literal not displayed */
}
type BalloonDevice ¶
type BalloonDevice struct {
ID string `json:"id" toml:"id"`
Transport string `json:"transport" toml:"transport"`
DeflateOnOOM bool `json:"deflateOnOOM,omitempty" toml:"deflateOnOOM"`
FreePageReporting bool `json:"freePageReporting,omitempty" toml:"freePageReporting"`
Controller *BalloonControllerConfig `json:"controller,omitempty" toml:"controller"`
}
BalloonDevice is the resolved virtio-balloon device configuration.
type BalloonInput ¶
type BalloonInput struct {
Enabled bool `json:"enabled,omitempty" toml:"enabled" jsonschema:"Enable the virtio memory balloon device."`
DeflateOnOOM bool `` /* 135-byte string literal not displayed */
// Pointer preserves omitted vs explicitly false input until resolution.
FreePageReporting *bool `` /* 148-byte string literal not displayed */
Controller *BalloonControllerInput `` /* 129-byte string literal not displayed */
}
type CPUCount ¶
func ExplicitCPUs ¶
type Command ¶
type Command struct {
Path string `json:"path"`
Args []string `json:"args,omitempty"`
Env []string `json:"env,omitempty"`
}
func RenderCommand ¶
type Document ¶
type Document struct {
HostName string `` /* 143-byte string literal not displayed */
WorkingDir string `` /* 143-byte string literal not displayed */
StateDir string `` /* 155-byte string literal not displayed */
Host HostInput `json:"host,omitempty" toml:"host" jsonschema:"Host platform facts used while resolving QEMU defaults."`
QEMU QEMUInput `json:"qemu,omitempty" toml:"qemu" jsonschema:"QEMU executable and host-side socket settings."`
Machine MachineInput `json:"machine,omitempty" toml:"machine" jsonschema:"Virtual machine type CPU memory and acceleration settings."`
Kernel KernelInput `json:"kernel" toml:"kernel" jsonschema:"Guest kernel initrd and kernel command-line settings."`
Graphics *GraphicsInput `json:"graphics,omitempty" toml:"graphics" jsonschema:"Graphical display backend settings."`
Mounts MountsInput `json:"mounts,omitempty" toml:"mounts" jsonschema:"Storage and filesystem devices attached at launch."`
Workspace WorkspaceInput `` /* 130-byte string literal not displayed */
Networks []NetworkInput `json:"networks,omitempty" toml:"networks" jsonschema:"Network devices and port forwards attached at launch."`
Balloon *BalloonInput `json:"balloon,omitempty" toml:"balloon" jsonschema:"Virtio memory balloon device and optional controller settings."`
SSH SSHInput `json:"ssh,omitempty" toml:"ssh" jsonschema:"SSH command and readiness settings for attaching to the guest."`
VSock VSockInput `json:"vsock,omitempty" toml:"vsock" jsonschema:"Allowed runtime vsock CID allocation range."`
WriteFiles []WriteFileInput `` /* 135-byte string literal not displayed */
Notifications NotificationsInput `` /* 133-byte string literal not displayed */
Run []RunInput `json:"run,omitempty" toml:"run" jsonschema:"Host-side processes started before QEMU and stopped during teardown."`
Hotplug HotplugInput `json:"hotplug,omitempty" toml:"hotplug" jsonschema:"Devices that may be attached or detached after launch."`
}
func DefaultDocument ¶
func DefaultDocument() Document
DefaultDocument returns the manifest input defaults that virtle assumes when optional fields are omitted. Required fields without defaults, such as kernel.path and kernel.initrd_path, are intentionally left unset.
func DocumentWithDefaults ¶
DocumentWithDefaults returns document overlaid on DefaultDocument. Pointer, slice, and map fields keep omission semantics: nil means omitted and receives the default; non-nil empty values are preserved. Scalar durations whose zero is meaningful (guest_default_timeout, shutdown_timeout) or invalid (ssh.retry_delay) are always taken from document; DecodeDocumentBytes seeds their defaults before decoding, so documents built in code must set them explicitly.
func (Document) ManifestWithOptions ¶
func (d Document) ManifestWithOptions(options ResolveOptions) (*Manifest, error)
type ForwardPort ¶
type ForwardPort struct {
Proto string `json:"proto" toml:"proto" jsonschema:"Transport protocol for the forwarded port."`
From string `json:"from" toml:"from" jsonschema:"Forwarding direction: host or guest."`
Host string `json:"host" toml:"host" jsonschema:"Host endpoint address in address:port form."`
Guest string `json:"guest" toml:"guest" jsonschema:"Guest endpoint address in address:port form."`
}
type ForwardTemplateProvider ¶
func (ForwardTemplateProvider) TemplateContext ¶
func (p ForwardTemplateProvider) TemplateContext() executor.Context
type GraphicsInput ¶
type GraphicsInput struct {
Backend string `json:"backend,omitempty" toml:"backend" jsonschema:"Display backend; headless disables graphical output."`
}
type HotplugBlock ¶
type HotplugDevice ¶
type HotplugDevice struct {
Kind HotplugKind `json:"kind"`
ID string `json:"id"`
VirtioFS HotplugVirtioFS `json:"virtiofs,omitempty"`
Net HotplugNet `json:"net,omitempty"`
Block HotplugBlock `json:"block,omitempty"`
}
HotplugDevice is a resolved hotplug device description. It is the manifest's vocabulary for devices that attach to and detach from a running VM; backends turn it into their own attach mechanism.
type HotplugForward ¶
type HotplugInput ¶
type HotplugInput struct {
Mounts MountsInput `json:"mounts,omitempty" toml:"mounts" jsonschema:"Mount devices available for later hotplug attach or detach."`
Networks []NetworkInput `json:"networks,omitempty" toml:"networks" jsonschema:"Network devices available for later hotplug attach or detach."`
}
func (HotplugInput) Len ¶
func (h HotplugInput) Len() int
func (HotplugInput) VirtioFS ¶
func (h HotplugInput) VirtioFS() []VirtioFSMountInput
type HotplugKind ¶
type HotplugKind string
HotplugKind identifies the kind of a resolved hotplug device.
const ( HotplugKindVirtioFS HotplugKind = "virtiofs" HotplugKindNet HotplugKind = "net" HotplugKindBlock HotplugKind = "block" )
type HotplugNet ¶
type HotplugNet struct {
Backend string `json:"backend"`
MAC string `json:"mac"`
Forward []HotplugForward `json:"forward,omitempty"`
}
type HotplugVirtioFS ¶
type ImageInput ¶
type ImageInput struct {
Size units.MiB `json:"size,omitempty" toml:"size" jsonschema:"Image size in MiB when creating the image."`
FSType string `json:"fs,omitempty" toml:"fs" jsonschema:"Filesystem type used when creating the image."`
Format string `json:"format,omitempty" toml:"format" jsonschema:"QEMU image format such as raw or qcow2."`
AutoCreate bool `json:"create,omitempty" toml:"create" jsonschema:"Create and format the image if it does not exist."`
// Pointer preserves omitted vs explicitly empty input until resolution.
Label *string `json:"label,omitempty" toml:"label" jsonschema:"Optional filesystem label used when creating the image."`
Direct bool `json:"direct,omitempty" toml:"direct" jsonschema:"Use direct I/O cache settings for the block device."`
// Pointer preserves omitted vs explicitly empty input until resolution.
Serial *string `json:"serial,omitempty" toml:"serial" jsonschema:"Optional disk serial exposed to the guest."`
}
type ImageMountInput ¶
type ImageMountInput struct {
Type string `json:"type" toml:"type" jsonschema:"Mount kind; must be image for this entry."`
SourcePath string `json:"source" toml:"source" jsonschema:"Host disk image path."`
ReadOnly bool `json:"read_only,omitempty" toml:"read_only" jsonschema:"Attach the image read-only."`
Image ImageInput `json:"image,omitempty" toml:"image" jsonschema:"Disk image creation and format settings."`
}
type KernelInput ¶
type KernelInput struct {
Path string `json:"path" toml:"path" jsonschema:"Path to the guest kernel image."`
InitrdPath string `json:"initrd_path" toml:"initrd_path" jsonschema:"Path to the guest initrd image."`
Params []string `json:"params,omitempty" toml:"params" jsonschema:"Additional kernel command-line parameters appended after virtle defaults."`
Serial string `json:"serial,omitempty" toml:"serial" default:"off" jsonschema:"Serial console mode: off print or console."`
}
type MachineInput ¶
type MachineInput struct {
Type string `json:"type,omitempty" toml:"type" default:"microvm" jsonschema:"QEMU machine type to use when resolving device transports."`
VCPU int `json:"vcpu,omitempty" toml:"vcpu" jsonschema:"Number of virtual CPUs to expose to the guest; zero derives the count."`
ID string `json:"id,omitempty" toml:"id" jsonschema:"Optional machine identifier passed through to QEMU."`
Memory units.MiB `json:"memory,omitempty" toml:"memory" default:"1024" jsonschema:"Guest memory size in MiB."`
CPU string `json:"cpu,omitempty" toml:"cpu" jsonschema:"QEMU CPU model string."`
// Pointer preserves omitted vs explicitly false input until resolution.
KVM *bool `json:"kvm,omitempty" toml:"kvm" jsonschema:"Whether QEMU should enable KVM acceleration when supported."`
}
type Manifest ¶
type Manifest struct {
Identity Identity `json:"identity"`
Paths Paths `json:"paths"`
Persistence Persistence `json:"persistence"`
SSH SSH `json:"ssh"`
QEMU QEMU `json:"qemu"`
Volumes []Volume `json:"volumes,omitempty"`
VSock VSock `json:"vsock"`
Workspace Workspace `json:"workspace,omitempty"`
WriteFiles WriteFiles `json:"writeFiles,omitempty"`
Notifications Notifications `json:"notifications,omitempty"`
Run []Run `json:"run,omitempty"`
Hotplug []HotplugDevice `json:"hotplug,omitempty"`
CleanupFiles []string `json:"cleanupFiles,omitempty"`
}
func DefaultManifest ¶
DefaultManifest returns the fully resolved manifest defaults. Since kernel paths are required inputs and have no default, placeholder values are used so resolution can show all derived runtime defaults.
func (*Manifest) GuestCommandContext ¶
GuestCommandContext bounds a guest-agent command with the manifest's guest command timeout.
func (*Manifest) ResolvedCleanupFiles ¶
func (*Manifest) ResolvedControlSocketPath ¶
func (*Manifest) ResolvedExternalVirtioFSSocketPaths ¶
func (*Manifest) ResolvedGuestAgentSocketPath ¶
func (*Manifest) ResolvedLockPath ¶
func (*Manifest) ResolvedNotifications ¶
func (m *Manifest) ResolvedNotifications() Notifications
func (*Manifest) ResolvedPersistenceBaseDir ¶
func (*Manifest) ResolvedPersistenceDirectories ¶
func (*Manifest) ResolvedPersistenceStateDir ¶
func (*Manifest) ResolvedQEMU ¶
func (*Manifest) ResolvedQMPSocketPath ¶
func (*Manifest) ResolvedRuns ¶
func (m *Manifest) ResolvedRuns(cid int) ([]ResolvedRun, error)
func (*Manifest) ResolvedSSHReadySocketPath ¶
func (*Manifest) ResolvedVirtioFSSocketPaths ¶
func (*Manifest) ResolvedVolumes ¶
func (*Manifest) ResolvedWriteFiles ¶
func (m *Manifest) ResolvedWriteFiles() []ResolvedWriteFile
func (*Manifest) SSHDestination ¶
func (*Manifest) SSHRetryDelay ¶
type MountEntry ¶
type MountEntry interface {
// contains filtered or unexported methods
}
type MountInput ¶
type MountInput struct {
Tag string `json:"tag" toml:"tag" jsonschema:"Stable QEMU mount tag or device identifier."`
SourcePath string `json:"source,omitempty" toml:"source" jsonschema:"Host path or image path backing this mount."`
ReadOnly bool `json:"read_only,omitempty" toml:"read_only" jsonschema:"Attach the mount or image read-only."`
}
type MountsInput ¶
type MountsInput []MountEntry
func (MountsInput) Image ¶
func (m MountsInput) Image() []ImageMountInput
func (MountsInput) MarshalJSON ¶
func (m MountsInput) MarshalJSON() ([]byte, error)
func (MountsInput) NineP ¶
func (m MountsInput) NineP() []NinePMountInput
func (MountsInput) RequiresPCI ¶
func (m MountsInput) RequiresPCI() bool
func (*MountsInput) UnmarshalJSON ¶
func (m *MountsInput) UnmarshalJSON(data []byte) error
func (*MountsInput) UnmarshalTOML ¶
func (m *MountsInput) UnmarshalTOML(data any) error
func (MountsInput) VirtioFS ¶
func (m MountsInput) VirtioFS() []VirtioFSMountInput
type NetworkInput ¶
type NetworkInput struct {
ID string `json:"id,omitempty" toml:"id" jsonschema:"QEMU network device identifier."`
Type string `json:"type,omitempty" toml:"type" jsonschema:"Network backend type."`
MAC string `json:"mac,omitempty" toml:"mac" jsonschema:"Guest network interface MAC address."`
Forward []ForwardPort `json:"forward,omitempty" toml:"forward" jsonschema:"Port forwarding rules for this network backend."`
}
type NinePInput ¶
type NinePInput struct {
SecurityModel string `json:"security_model,omitempty" toml:"security_model" jsonschema:"QEMU 9p security model."`
}
type NinePMountInput ¶
type NinePMountInput struct {
Type string `json:"type" toml:"type" jsonschema:"Mount kind; must be 9p for this entry."`
MountInput
NineP NinePInput `json:"9p,omitempty" toml:"9p" jsonschema:"9p-specific mount options."`
}
type NotificationTemplateProvider ¶
func (NotificationTemplateProvider) TemplateContext ¶
func (p NotificationTemplateProvider) TemplateContext() executor.Context
type Notifications ¶
type NotificationsInput ¶
type Paths ¶
type Paths struct {
WorkingDir string `json:"workingDir"`
LockPath string `json:"lockPath"`
RuntimeDir RuntimeDir `json:"runtimeDir,omitempty"`
}
type Persistence ¶
type PortEndpoint ¶
type QEMU ¶
type QEMU struct {
BinaryPath string `json:"binaryPath"`
Name string `json:"name"`
Machine QEMUMachine `json:"machine"`
CPU QEMUCPU `json:"cpu"`
Memory QEMUMemory `json:"memory"`
Kernel QEMUKernel `json:"kernel"`
SMP QEMUSMP `json:"smp"`
Console QEMUConsole `json:"console"`
Knobs QEMUKnobs `json:"knobs"`
Graphics QEMUGraphics `json:"graphics,omitempty"`
QMP QEMUQMP `json:"qmp"`
GuestAgent QEMUGuestAgent `json:"guestAgent,omitempty"`
SSHReady QEMUSSHReady `json:"sshReady,omitempty"`
Hotplug QEMUHotplug `json:"hotplug,omitempty"`
Devices QEMUDevices `json:"devices"`
MachineID string `json:"machineId,omitempty"`
PassthroughArgs []string `json:"passthroughArgs,omitempty"`
}
func (QEMU) NoGraphicEnabled ¶
type QEMUBlockDevice ¶
type QEMUBlockDevice struct {
ID string `json:"id"`
ImagePath string `json:"imagePath"`
Format string `json:"format,omitempty"`
AIO string `json:"aio,omitempty"`
Cache string `json:"cache,omitempty"`
ReadOnly bool `json:"readOnly,omitempty"`
Serial string `json:"serial,omitempty"`
Transport string `json:"transport"`
}
type QEMUConsole ¶
type QEMUConsole string
const ( QEMUConsoleOff QEMUConsole = KernelSerialOff QEMUConsolePrint QEMUConsole = KernelSerialPrint QEMUConsoleInteractive QEMUConsole = KernelSerialConsole )
func (QEMUConsole) Enabled ¶
func (c QEMUConsole) Enabled() bool
func (QEMUConsole) Interactive ¶
func (c QEMUConsole) Interactive() bool
type QEMUDevices ¶
type QEMUDevices struct {
RNG QEMURNGDevice `json:"rng"`
I8042 bool `json:"i8042,omitempty"`
Balloon *BalloonDevice `json:"balloon,omitempty"`
VirtioFS []QEMUVirtioFSShare `json:"virtiofs,omitempty"`
NineP []QEMUNinePShare `json:"9p,omitempty"`
Block []QEMUBlockDevice `json:"block,omitempty"`
Mounts []QEMUMountDevice `json:"mounts,omitempty"`
Network []QEMUNetDevice `json:"network,omitempty"`
VSOCK QEMUVSOCKDevice `json:"vsock"`
}
type QEMUGraphics ¶
type QEMUGraphics struct {
Backend string `json:"backend"`
}
func (QEMUGraphics) IsZero ¶
func (g QEMUGraphics) IsZero() bool
type QEMUGuestAgent ¶
type QEMUHotplug ¶
type QEMUHotplug struct {
PCIEPorts int `json:"pciePorts,omitempty"`
}
type QEMUInput ¶
type QEMUInput struct {
Exec []string `json:"exec,omitempty" toml:"exec" jsonschema:"Command template used to launch QEMU; the first element is the QEMU binary."`
FwdTunnelExec []string `` /* 127-byte string literal not displayed */
User string `json:"user,omitempty" toml:"user" jsonschema:"Host user used for QEMU-related process policy when supported."`
Seccomp bool `json:"seccomp,omitempty" toml:"seccomp" jsonschema:"Enable QEMU seccomp sandboxing."`
MachineOptions map[string]string `` /* 146-byte string literal not displayed */
QMPSocket string `` /* 175-byte string literal not displayed */
GuestAgentSocket string `` /* 186-byte string literal not displayed */
GuestDefaultTimeout units.Duration `` /* 294-byte string literal not displayed */
ShutdownExec []string `` /* 145-byte string literal not displayed */
ShutdownTimeout units.Duration `` /* 151-byte string literal not displayed */
HotplugPorts int `` /* 244-byte string literal not displayed */
}
type QEMUKernel ¶
type QEMUMachine ¶
type QEMUMemory ¶
type QEMUMountDevice ¶
type QEMUMountDevice struct {
Type string `json:"type"`
VirtioFS *QEMUVirtioFSShare `json:"virtiofs,omitempty"`
NineP *QEMUNinePShare `json:"9p,omitempty"`
Block *QEMUBlockDevice `json:"block,omitempty"`
}
type QEMUNetDevice ¶
type QEMUNetDevice struct {
ID string `json:"id"`
Backend string `json:"backend"`
MacAddress string `json:"macAddress"`
Transport string `json:"transport"`
RomFile string `json:"romFile,omitempty"`
DisableROM bool `json:"disableROM,omitempty"`
NetdevOptions []string `json:"netdevOptions,omitempty"`
MQVectors int `json:"mqVectors,omitempty"`
}
type QEMUNinePShare ¶
type QEMUNinePShare struct {
}
type QEMURNGDevice ¶
type QEMUSSHReady ¶
type QEMUSSHReady struct {
SocketPath string `json:"socketPath,omitempty"`
}
type QEMUTemplateProvider ¶
type QEMUTemplateProvider struct {
HostName string
WorkingDir string
StateDir string
Host HostInput
}
func (QEMUTemplateProvider) TemplateContext ¶
func (p QEMUTemplateProvider) TemplateContext() executor.Context
type QEMUVSOCKDevice ¶
type QEMUVirtioFSShare ¶
type QEMUVirtioFSShare struct {
}
type RangeInput ¶
type ResolveOptions ¶
type ResolvedRun ¶
type ResolvedWriteFile ¶
type RunTemplateProvider ¶
func (RunTemplateProvider) TemplateContext ¶
func (p RunTemplateProvider) TemplateContext() executor.Context
type RuntimeDir ¶
type RuntimeDir struct {
Mode RuntimeDirMode `json:"mode,omitempty"`
Path string `json:"path,omitempty"`
}
type RuntimeDirMode ¶
type RuntimeDirMode int
const ( RuntimeDirWorking RuntimeDirMode = iota RuntimeDirXDG RuntimeDirPath )
type SSHInput ¶
type SSHInput struct {
Exec []string `json:"exec,omitempty" toml:"exec" jsonschema:"SSH command template used to attach to the guest."`
User string `json:"user,omitempty" toml:"user" default:"agent" jsonschema:"Guest SSH username."`
ReadySocket string `` /* 147-byte string literal not displayed */
RetryDelay units.Duration `` /* 161-byte string literal not displayed */
Autoprovision bool `` /* 129-byte string literal not displayed */
}
type SSHTemplateProvider ¶
func (SSHTemplateProvider) TemplateContext ¶
func (p SSHTemplateProvider) TemplateContext() executor.Context
type TemplateContextFunc ¶
func (TemplateContextFunc) TemplateContext ¶
func (f TemplateContextFunc) TemplateContext() executor.Context
type TemplateProvider ¶
TemplateProvider contributes values to an exec template rendering context.
func StaticTemplateContext ¶
func StaticTemplateContext(values executor.Context) TemplateProvider
type VSock ¶
type VSock struct {
CIDRange VSockCIDRange `json:"cidRange"`
}
type VSockCIDRange ¶
type VSockInput ¶
type VSockInput struct {
CIDRange RangeInput `json:"cid_range,omitempty" toml:"cid_range" jsonschema:"Inclusive range of vsock CIDs virtle may allocate at launch."`
}
type VirtioFSInput ¶
type VirtioFSInput struct {
Socket string `` /* 135-byte string literal not displayed */
Bin string `json:"bin,omitempty" toml:"bin" jsonschema:"Virtiofs daemon executable path or wrapper script."`
Args []string `json:"args,omitempty" toml:"args" jsonschema:"Arguments for the virtiofs daemon command."`
}
type VirtioFSMountInput ¶
type VirtioFSMountInput struct {
Type string `json:"type" toml:"type" jsonschema:"Mount kind; must be virtiofs for this entry."`
MountInput
Target string `json:"target,omitempty" toml:"target" jsonschema:"Optional guest mount target used for hotplug guest mount commands."`
VirtioFS VirtioFSInput `json:"virtiofs,omitempty" toml:"virtiofs" jsonschema:"Virtiofs daemon socket and command settings."`
}
type VirtioFSTemplateProvider ¶
func (VirtioFSTemplateProvider) TemplateContext ¶
func (p VirtioFSTemplateProvider) TemplateContext() executor.Context
type WorkspaceInput ¶
type WorkspaceInput struct {
GuestDir string `json:"guest_dir,omitempty" toml:"guest_dir" jsonschema:"Guest workspace directory used in templates."`
HostDir string `json:"host_dir,omitempty" toml:"host_dir" jsonschema:"Host workspace directory used in templates."`
MountCWD bool `json:"mount_cwd,omitempty" toml:"mount_cwd" jsonschema:"Mount the current working directory into the guest after launch."`
}
type WriteFileContent ¶
type WriteFileContent struct {
Kind WriteFileContentKind `json:"kind,omitempty"`
Text string `json:"text,omitempty"`
Path string `json:"path,omitempty"`
}
type WriteFileContentKind ¶
type WriteFileContentKind int
const ( WriteFileContentNone WriteFileContentKind = iota WriteFileContentText WriteFileContentPath )
type WriteFileInput ¶
type WriteFileInput struct {
GuestPath string `json:"guest_path" toml:"guest_path" jsonschema:"Absolute guest path to write."`
// Pointer preserves omitted vs explicitly empty input until resolution.
Chown *string `json:"chown,omitempty" toml:"chown" jsonschema:"Optional guest owner and group in owner:group form."`
// Pointer preserves omitted vs explicitly empty input until resolution.
Text *string `json:"text,omitempty" toml:"text" jsonschema:"Inline text content to write to the guest path."`
// Pointer preserves omitted vs explicitly empty input until resolution.
Mode *string `json:"mode,omitempty" toml:"mode" jsonschema:"Optional file mode matching ^0?[0-7]{3}$."`
// Pointer preserves omitted vs explicitly false input until resolution.
Overwrite *bool `json:"overwrite,omitempty" toml:"overwrite" jsonschema:"Overwrite an existing guest file."`
// Pointer preserves omitted vs explicitly false input until resolution.
FollowLinks *bool `json:"follow_links,omitempty" toml:"follow_links" jsonschema:"Follow symlinks when reading source content from the host."`
// Pointer preserves omitted vs explicitly false input until resolution.
WriteBack *bool `json:"write_back,omitempty" toml:"write_back" jsonschema:"Copy guest changes back to the host source path during teardown."`
// Pointer preserves omitted vs explicitly empty input until resolution.
Path *string `json:"source,omitempty" toml:"source" jsonschema:"Host source path for file content."`
}
type WriteFiles ¶
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package schema generates the JSON Schema for the manifest input format.
|
Package schema generates the JSON Schema for the manifest input format. |
|
Package tagged decodes and encodes JSON-style tagged union lists.
|
Package tagged decodes and encodes JSON-style tagged union lists. |