Documentation
¶
Overview ¶
Package qemu implements a QEMU/KVM-based Provider for GPU passthrough environments. It mirrors the firecracker package: a remote HTTP host-agent client plus an in-memory stub fallback for dev/tests so Fleet/Boot stay provider-agnostic.
The QEMU Environment deliberately does NOT implement orchestrator.SnapshotCapable: a VFIO-passed-through GPU cannot be checkpointed, so snapshot and fork must fail cleanly (see decision D4). The missing methods are what the orchestrator's SnapshotCapable/SnapshotForkable type assertions key off, so no core changes are needed.
Index ¶
- type Config
- type Provider
- func (p *Provider) Capacity(ctx context.Context) (orchestrator.HostCapacity, error)
- func (p *Provider) Close() error
- func (p *Provider) Create(ctx context.Context, spec orchestrator.Spec) (orchestrator.Environment, error)
- func (p *Provider) Destroy(ctx context.Context, name string) error
- func (p *Provider) Get(ctx context.Context, name string) (orchestrator.Environment, error)
- func (p *Provider) List(ctx context.Context, prefix string) ([]orchestrator.Environment, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
BaseURL string // host agent base URL, e.g. https://gpu-host.local
Token string // bearer token for auth
HTTPClient *http.Client // optional; defaults to http.DefaultClient
UseStub bool // force in-memory stub (for dev/tests)
DownloadURL string // optional URL to fetch the guest agent binary
}
Config configures the QEMU provider client.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider implements orchestrator.Provider backed by a QEMU host agent API. If UseStub is true or BaseURL is empty, it falls back to an in-memory stub that simulates behavior without real VMs.
func (*Provider) Capacity ¶ added in v0.4.0
func (p *Provider) Capacity(ctx context.Context) (orchestrator.HostCapacity, error)
Capacity implements orchestrator.CapacityProber by asking the host agent for its real CPU count, total RAM, and free disk via GET /v1/capacity. Not supported in stub mode: there is no real hardware for the in-memory stub to report on.
func (*Provider) Create ¶
func (p *Provider) Create(ctx context.Context, spec orchestrator.Spec) (orchestrator.Environment, error)
Create provisions a new sandbox. When spec.GPUs > 0, the GPU count and kind are forwarded to the host agent so it can attach VFIO devices; GPUs == 0 omits them (task 3.2).
func (*Provider) Get ¶
func (p *Provider) Get(ctx context.Context, name string) (orchestrator.Environment, error)
Get returns an existing sandbox.
func (*Provider) List ¶
func (p *Provider) List(ctx context.Context, prefix string) ([]orchestrator.Environment, error)
List returns all sandboxes matching the given prefix.