qemu

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2026 License: MIT Imports: 10 Imported by: 0

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

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 New

func New(cfg Config) *Provider

New creates a QEMU provider.

func (*Provider) Close

func (p *Provider) Close() error

Close releases resources.

func (*Provider) Create

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) Destroy

func (p *Provider) Destroy(ctx context.Context, name string) error

Destroy tears down a sandbox.

func (*Provider) Get

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.

Jump to

Keyboard shortcuts

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