Documentation
¶
Overview ¶
Package remote is a pure-Go backend.Backend that drives a spawned helper over the control protocol instead of touching a hypervisor directly. It is the client half of the ADR-0020 inversion: the orchestrator links THIS backend, so its import graph carries no vz/cloud-hypervisor (the macOS sever, now uniform); the real backend lives in the helper, reached by RPC.
The mapping to the wire protocol:
- CreateNetwork -> createnetwork RPC (returns the subnet)
- Network.Reserve-> reserve RPC (returns the member's {ip, mac})
- Create -> stash the resolved spec (no RPC yet)
- VM.Start -> boot-member RPC (the helper does backend.Create+Start)
- VM.WaitForIP -> poll the per-member status until running with an IP
- VM.Stop -> stop RPC
Cluster-level RPCs (createnetwork/reserve/boot-member) travel over the primary member's socket; per-member status/stop travel over the target's own socket. NestedVirtSupported/SupportsClustering are NOT routed here — the client answers host capability with a pure-Go heuristic before any spawn (ADR-0017, R7), so the orchestrator never consults them on this backend.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend translates backend.Backend calls into control-protocol RPCs against a helper the caller has already spawned. primary is the member whose socket carries the cluster-level RPCs (it always exists for the cluster's lifetime).
func New ¶
New creates a remote-proxy backend that drives the helper serving `primary` over the store's sockets.
func (*Backend) Create ¶
Create stashes the resolved spec and returns a VM handle; the boot-member RPC that actually creates and starts the guest is sent by VM.Start, matching the orchestrator's Create-then-Start order while keeping the helper's create+start atomic.
func (*Backend) CreateNetwork ¶
CreateNetwork asks the helper to create the cluster's shared network and returns a Network carrying the reported subnet (empty on the DHCP/vz path).
func (*Backend) NestedVirtSupported ¶
NestedVirtSupported satisfies the interface but is never consulted on the remote backend — the client decides host capability without the helper (R7).
func (*Backend) Reconcile ¶
Reconcile is a no-op here: prune drives a dedicated short-lived reconcile helper, not the remote proxy (ADR-0013/0020).
func (*Backend) SupportsClustering ¶
SupportsClustering satisfies the interface but is never consulted on the remote backend — the root package's pure-Go host gate decides it before any spawn.
type Network ¶
type Network struct {
// contains filtered or unexported fields
}
Network is a handle to the helper's shared cluster network.
func (*Network) Close ¶
Close is a no-op: the helper owns the live network and tears it down on its own teardown (death-watch or last member stopped). The client has no close RPC — closing the network from under live siblings would be a bug (mirrors vz GC).
type VM ¶
type VM struct {
// contains filtered or unexported fields
}
VM is a handle to one member booted by the helper.
func (*VM) Start ¶
Start sends the boot-member RPC; the helper creates and starts the guest on the shared network using the address it reserved for this member, then replies. The member's runtime IP (vz DHCP) is discovered helper-side and surfaced by status, so callers follow Start with WaitForIP.
func (*VM) State ¶
State reports the member's state from the helper, mapped onto backend.State. A missing/unreachable holder reads as stopped.
func (*VM) Stop ¶
Stop sends the stop RPC and waits for the member to retire (control.Stop polls its pidfile).
func (*VM) Wait ¶
Wait blocks until the member is no longer running (stopped or errored) or ctx is done, by polling status.