Documentation
¶
Overview ¶
Package fs is the runtime attach interface for vhost-user-fs devices (typically backed by virtiofsd) on a running VM.
State semantics: attach is runtime-only. Attached devices are not persisted in the VM record and disappear when the VM stops. The user must re-attach after a restart. Cocoon does not own the virtiofsd backend.
Index ¶
Constants ¶
const ( DefaultNumQueues = 1 DefaultQueueSize = 1024 )
Variables ¶
var ( // ErrUnsupportedBackend signals the resolved hypervisor backend cannot // hot-plug vhost-user-fs (e.g. Firecracker). ErrUnsupportedBackend = errors.New("backend does not support fs attach") )
Functions ¶
Types ¶
type Attached ¶
type Attached struct {
ID string `json:"id"`
Tag string `json:"tag"`
Socket string `json:"socket"`
}
Attached is the inspect-time view of one fs device read from the running VM's CH config.
type Attacher ¶
type Attacher interface {
FsAttach(ctx context.Context, vmRef string, spec Spec) (deviceID string, err error)
FsDetach(ctx context.Context, vmRef, tag string) error
}
Attacher hot-plugs and removes vhost-user-fs devices.
type Spec ¶
Spec is one attach request.
func (*Spec) Normalize ¶
Normalize enforces required fields and applies queue-size defaults. Mutates the receiver — callers expect the post-call Spec to be ready for serialization. Mirror vfio.Spec.NormalizedPath in spirit (compute + validate in one call) so future Specs in extend/ converge on the same idiom rather than fan out into pure-Validate vs. mutating-Validate styles.