This repository has no description
1//go:build linux
2
3package microvm
4
5import (
6 "context"
7 "fmt"
8 "log/slog"
9)
10
11type Runner interface {
12 // check the host has what this backend needs for spec.
13 Validate(spec ImageSpec, enableKVM bool) error
14 Start(ctx context.Context, cfg VMConfig, volumePaths map[string]string, logger *slog.Logger) (VMHandle, error)
15}
16
17func runnerFor(runnerType string) (Runner, error) {
18 switch runnerType {
19 case "qemu", "":
20 return qemuRunner{}, nil
21 case "firecracker":
22 return nil, fmt.Errorf("runner type %q not implemented yet", runnerType)
23 default:
24 return nil, fmt.Errorf("unsupported runner type %q", runnerType)
25 }
26}