netresize

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package netresize is the runtime interface for resizing a VM's NIC count.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedBackend = errors.New("backend does not support net resize")

ErrUnsupportedBackend signals the resolved hypervisor cannot resize NICs.

Functions

This section is empty.

Types

type NIC

type NIC struct {
	Index int    `json:"index"`
	TAP   string `json:"tap"`
	MAC   string `json:"mac"`
}

NIC is one NIC summary surfaced through Result.Added / Result.Removed.

type Plumbing

type Plumbing interface {
	Add(ctx context.Context, vmID string, vmCfg *types.VMConfig, specs ...network.AddSpec) ([]*types.NetworkConfig, error)
	Remove(ctx context.Context, vmID string, indices ...int) error
}

Plumbing is the host-side network ops NetResize delegates to; network.Network satisfies it.

type Resizer

type Resizer interface {
	NetResize(ctx context.Context, vmRef string, spec Spec, plumbing Plumbing) (Result, error)
}

Resizer resizes a running VM's NIC count.

type Result

type Result struct {
	Before   int      `json:"before"`
	After    int      `json:"after"`
	Added    []NIC    `json:"added,omitempty"`
	Removed  []NIC    `json:"removed,omitempty"`
	Warnings []string `json:"warnings,omitempty"`
}

Result reports the before/after count, NICs touched, and non-fatal Warnings.

type Spec

type Spec struct {
	Target int
}

Spec is one resize request.

func (*Spec) Normalize

func (s *Spec) Normalize() error

Normalize validates the spec.

Jump to

Keyboard shortcuts

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