fs

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: 6 Imported by: 0

Documentation

Overview

Package fs is the runtime attach interface for vhost-user-fs devices (typically virtiofsd). Attach is runtime-only — devices don't persist past VM stop; re-attach after restart.

Index

Constants

View Source
const (
	DefaultNumQueues = 1
	DefaultQueueSize = 1024
)

Variables

View Source
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

func DeriveID

func DeriveID(tag string) string

DeriveID returns the deterministic CH device id for a tag (used by attach + detach so concurrent attaches collide on CH's id check).

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 Lister

type Lister interface {
	FsList(ctx context.Context, vmRef string) ([]Attached, error)
}

Lister enumerates currently-attached fs devices from running VM state.

type Spec

type Spec struct {
	Socket    string
	Tag       string
	NumQueues int
	QueueSize int
}

Spec is one attach request.

func (*Spec) Normalize

func (s *Spec) Normalize() error

Normalize enforces required fields and applies queue-size defaults; mutates the receiver.

Jump to

Keyboard shortcuts

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