package driver
import "context"
type ProcessExit interface {
Done() <-chan struct{}
Err() error
}
type ResourceArgs struct {
CPUBoot int64
CPUMax int64
MemorySize int64
MemoryPath string
NetNSPath string
TapName string
KernelPath string
InitrdPath string
PmemPaths []string
VirtioFS []VirtioFSDevice
SnapfilePath string
VsockCID uint32
VsockSocketPath string
SandboxId string
EventMonitorFd int
ApiSocketFd int
}
type VirtioFSDevice struct {
Tag string
Socket string
}
type Adapter interface {
BuildStartCmd(args *ResourceArgs, restore bool) (string, error)
PrepareLaunch(args *ResourceArgs, restore bool) error
AfterProcessStart()
WaitForCreateReady(ctx context.Context, processExited ProcessExit) error
WaitForRestoreReady(ctx context.Context, processExited ProcessExit) error
CheckAgentAlive(ctx context.Context, processExited ProcessExit) error
PauseVM() error
ResumeVM() error
DeleteVM() error
CreateSnapshot(snapfilePath string) error
LoadSnapshot(snapfilePath string, preferVNC bool) error
Cleanup()
}