Documentation
¶
Overview ¶
Package disk is the runtime attach interface for extra virtio-blk disks backed by existing raw files. Attach is runtime-only — snapshot/hibernate is refused while one is attached; detach never deletes the backing file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrUnsupportedBackend = errors.New("backend does not support disk attach")
ErrUnsupportedBackend signals the backend cannot hot-plug virtio-blk disks (e.g. Firecracker).
Functions ¶
func DeriveID ¶
DeriveID returns the deterministic CH device id for a disk name (used by attach + detach so concurrent attaches collide on CH's id check).
func NameFromID ¶
NameFromID reverses DeriveID; empty when id is not a hot-added disk (foreign same-prefix ids with an illegal name suffix are not ours).
Types ¶
type Attached ¶
type Attached struct {
ID string `json:"id"`
Name string `json:"name"`
Path string `json:"path"`
ReadOnly bool `json:"readonly,omitempty"`
}
Attached is the inspect-time view of one hot-added disk read from the running VM's CH config.
type Attacher ¶
type Attacher interface {
DiskAttach(ctx context.Context, vmRef string, spec Spec) (deviceID string, err error)
DiskDetach(ctx context.Context, vmRef, name string) error
}
Attacher hot-plugs and removes virtio-blk data disks on a running VM.