cloudhypervisor

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const CowSerial = hypervisor.CowSerial

CowSerial is re-exported for backward compatibility.

Variables

This section is empty.

Functions

func DebugDiskCLIArgs

func DebugDiskCLIArgs(storageConfigs []*types.StorageConfig, cpuCount, diskQueueSize int, noDirectIO bool) []string

DebugDiskCLIArgs uses the same storage-to-disk mapping as launch.

func ReverseLayerSerials

func ReverseLayerSerials(storageConfigs []*types.StorageConfig) []string

ReverseLayerSerials extracts layer serials, reversed for overlayfs lowerdir.

Types

type CloudHypervisor

type CloudHypervisor struct {
	*hypervisor.Backend
	// contains filtered or unexported fields
}

CloudHypervisor implements hypervisor.Hypervisor.

func New

func New(conf *config.Config, rec metering.Recorder) (*CloudHypervisor, error)

New creates a CloudHypervisor backend. rec may be nil; the backend falls back to NopRecorder for emit calls.

func (*CloudHypervisor) Clone

func (ch *CloudHypervisor) Clone(ctx context.Context, vmID string, vmCfg *types.VMConfig, net types.NetSetup, snapshotConfig *types.SnapshotConfig, snapshot io.Reader) (*types.VM, error)

func (*CloudHypervisor) Console

func (ch *CloudHypervisor) Console(ctx context.Context, ref string) (io.ReadWriteCloser, error)

Console returns a bidirectional stream to the VM console: console.sock (UEFI) or the CH-allocated PTY (OCI). Caller closes the returned ReadWriteCloser.

func (*CloudHypervisor) Create

func (ch *CloudHypervisor) Create(ctx context.Context, id string, vmCfg *types.VMConfig, storageConfigs []*types.StorageConfig, net types.NetSetup, bootCfg *types.BootConfig) (*types.VM, error)

func (*CloudHypervisor) Delete

func (ch *CloudHypervisor) Delete(ctx context.Context, refs []string, force bool) ([]string, error)

Delete removes VMs. Running VMs require force=true (stops them first).

func (*CloudHypervisor) DeviceAttach added in v0.3.9

func (ch *CloudHypervisor) DeviceAttach(ctx context.Context, vmRef string, spec vfio.Spec) (string, error)

func (*CloudHypervisor) DeviceDetach added in v0.3.9

func (ch *CloudHypervisor) DeviceDetach(ctx context.Context, vmRef, id string) error

func (*CloudHypervisor) DeviceList added in v0.3.9

func (ch *CloudHypervisor) DeviceList(ctx context.Context, vmRef string) ([]vfio.Attached, error)

func (*CloudHypervisor) DirectClone

func (ch *CloudHypervisor) DirectClone(ctx context.Context, vmID string, vmCfg *types.VMConfig, net types.NetSetup, snapshotConfig *types.SnapshotConfig, srcDir string) (*types.VM, error)

DirectClone clones from a local snapshot dir. Per-type: hardlink memory-range-*, reflink/copy COW, plain copy metadata; cidata is regenerated.

func (*CloudHypervisor) DirectRestore

func (ch *CloudHypervisor) DirectRestore(ctx context.Context, vmRef string, vmCfg *types.VMConfig, srcDir, sourceSnapshotID string) (*types.VM, error)

func (*CloudHypervisor) FsAttach added in v0.3.9

func (ch *CloudHypervisor) FsAttach(ctx context.Context, vmRef string, spec fs.Spec) (string, error)

func (*CloudHypervisor) FsDetach added in v0.3.9

func (ch *CloudHypervisor) FsDetach(ctx context.Context, vmRef, tag string) error

func (*CloudHypervisor) FsList added in v0.3.9

func (ch *CloudHypervisor) FsList(ctx context.Context, vmRef string) ([]fs.Attached, error)

func (*CloudHypervisor) NetResize added in v0.4.0

func (ch *CloudHypervisor) NetResize(ctx context.Context, vmRef string, spec netresize.Spec, plumbing netresize.Plumbing) (netresize.Result, error)

NetResize brings the VM's NIC count to spec.Target on a running CH VM.

func (*CloudHypervisor) Restore

func (ch *CloudHypervisor) Restore(ctx context.Context, vmRef string, vmCfg *types.VMConfig, snapshot io.Reader, sourceSnapshotID string) (*types.VM, error)

func (*CloudHypervisor) Snapshot

Snapshot pauses, captures CH state+COW, resumes, and streams the result.

func (*CloudHypervisor) Start

func (ch *CloudHypervisor) Start(ctx context.Context, refs []string) ([]string, error)

func (*CloudHypervisor) Stop

func (ch *CloudHypervisor) Stop(ctx context.Context, refs []string) ([]string, error)

Stop shuts down each CH process: UEFI uses ACPI power-button; direct-boot uses vm.shutdown. Both fall back to SIGTERM→SIGKILL.

type Config

type Config struct {
	hypervisor.BaseConfig
}

Config holds Cloud Hypervisor specific configuration.

func NewConfig added in v0.3.1

func NewConfig(conf *config.Config) *Config

NewConfig creates a Config from a global config.

func (*Config) BinaryName added in v0.2.9

func (c *Config) BinaryName() string

func (*Config) COWRawPath

func (c *Config) COWRawPath(vmID string) string

func (*Config) CidataPath

func (c *Config) CidataPath(vmID string) string

func (*Config) OverlayPath

func (c *Config) OverlayPath(vmID string) string

func (*Config) PIDFileName added in v0.2.9

func (c *Config) PIDFileName() string

Jump to

Keyboard shortcuts

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