Skip to content

Commit d88adcf

Browse files
committed
Rename external driver to static driver
Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
1 parent 9d6ebeb commit d88adcf

File tree

14 files changed

+47
-47
lines changed

14 files changed

+47
-47
lines changed

pkg/driverutil/driverutil.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ func Drivers() []string {
1515
if wsl2.Enabled {
1616
drivers = append(drivers, limayaml.WSL2)
1717
}
18-
drivers = append(drivers, limayaml.EXT)
18+
drivers = append(drivers, limayaml.STATIC)
1919
return drivers
2020
}

pkg/driverutil/instance.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ package driverutil
22

33
import (
44
"github.com/lima-vm/lima/pkg/driver"
5-
"github.com/lima-vm/lima/pkg/ext"
65
"github.com/lima-vm/lima/pkg/limayaml"
76
"github.com/lima-vm/lima/pkg/qemu"
7+
"github.com/lima-vm/lima/pkg/static"
88
"github.com/lima-vm/lima/pkg/vz"
99
"github.com/lima-vm/lima/pkg/wsl2"
1010
)
@@ -17,8 +17,8 @@ func CreateTargetDriverInstance(base *driver.BaseDriver) driver.Driver {
1717
if *limaDriver == limayaml.WSL2 {
1818
return wsl2.New(base)
1919
}
20-
if *limaDriver == limayaml.EXT {
21-
return ext.New(base)
20+
if *limaDriver == limayaml.STATIC {
21+
return static.New(base)
2222
}
2323
return qemu.New(base)
2424
}

pkg/ext/ext_driver.go

-15
This file was deleted.

pkg/hostagent/hostagent.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func New(instName string, stdout io.Writer, signalCh chan os.Signal, opts ...Opt
138138
if err := cidata.GenerateCloudConfig(inst.Dir, instName, inst.Config); err != nil {
139139
return nil, err
140140
}
141-
if *inst.Config.VMType != limayaml.EXT {
141+
if *inst.Config.VMType != limayaml.STATIC {
142142
if err := cidata.GenerateISO9660(inst.Dir, instName, inst.Config, udpDNSLocalPort, tcpDNSLocalPort, o.nerdctlArchive, vSockPort, virtioPort); err != nil {
143143
return nil, err
144144
}
@@ -503,7 +503,7 @@ sudo chown -R "${USER}" /run/host-services`
503503
return errors.Join(unlockErrs...)
504504
})
505505
}
506-
if *a.instConfig.VMType == limayaml.EXT {
506+
if *a.instConfig.VMType == limayaml.STATIC {
507507
if err := a.runProvisionScripts(); err != nil {
508508
return err
509509
}

pkg/hostagent/requirements.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ If any private key under ~/.ssh is protected with a passphrase, you need to have
128128
if *a.instConfig.Plain {
129129
return req
130130
}
131-
if *a.instConfig.VMType != limayaml.EXT {
131+
if *a.instConfig.VMType != limayaml.STATIC {
132132
req = append(req,
133133
requirement{
134134
description: "user session is ready for ssh",
@@ -227,7 +227,7 @@ Also see "/var/log/cloud-init-output.log" in the guest.
227227

228228
func (a *HostAgent) finalRequirements() []requirement {
229229
req := make([]requirement, 0)
230-
if *a.instConfig.VMType != limayaml.EXT {
230+
if *a.instConfig.VMType != limayaml.STATIC {
231231
req = append(req,
232232
requirement{
233233
description: "boot scripts must have finished",

pkg/instance/start.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func Prepare(ctx context.Context, inst *store.Instance) (*Prepared, error) {
9898
if err := limaDriver.CreateDisk(ctx); err != nil {
9999
return nil, err
100100
}
101-
if *inst.Config.VMType == limayaml.EXT {
101+
if *inst.Config.VMType == limayaml.STATIC {
102102
// Created externally
103103
created = true
104104
}

pkg/limayaml/defaults.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1071,8 +1071,8 @@ func NewVMType(driver string) VMType {
10711071
return QEMU
10721072
case "wsl2":
10731073
return WSL2
1074-
case "ext":
1075-
return EXT
1074+
case "static":
1075+
return STATIC
10761076
default:
10771077
logrus.Warnf("Unknown driver: %s", driver)
10781078
return driver

pkg/limayaml/limayaml.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,17 @@ const (
7272
VIRTIOFS MountType = "virtiofs"
7373
WSLMount MountType = "wsl2"
7474

75-
QEMU VMType = "qemu"
76-
VZ VMType = "vz"
77-
WSL2 VMType = "wsl2"
78-
EXT VMType = "ext"
75+
QEMU VMType = "qemu"
76+
VZ VMType = "vz"
77+
WSL2 VMType = "wsl2"
78+
STATIC VMType = "static"
7979
)
8080

8181
var (
8282
OSTypes = []OS{LINUX}
8383
ArchTypes = []Arch{X8664, AARCH64, ARMV7L, RISCV64}
8484
MountTypes = []MountType{REVSSHFS, NINEP, VIRTIOFS, WSLMount}
85-
VMTypes = []VMType{QEMU, VZ, WSL2, EXT}
85+
VMTypes = []VMType{QEMU, VZ, WSL2, STATIC}
8686
)
8787

8888
type User struct {

pkg/limayaml/validate.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ func Validate(y *LimaYAML, warn bool) error {
8484
if !IsNativeArch(*y.Arch) {
8585
return fmt.Errorf("field `arch` must be %q for VZ; got %q", NewArch(runtime.GOARCH), *y.Arch)
8686
}
87-
case EXT:
87+
case STATIC:
8888
// NOP
8989
default:
90-
return fmt.Errorf("field `vmType` must be %q, %q, %q, %q; got %q", QEMU, VZ, WSL2, EXT, *y.VMType)
90+
return fmt.Errorf("field `vmType` must be %q, %q, %q, %q; got %q", QEMU, VZ, WSL2, STATIC, *y.VMType)
9191
}
9292

93-
if len(y.Images) == 0 && *y.VMType != EXT {
93+
if len(y.Images) == 0 && *y.VMType != STATIC {
9494
return errors.New("field `images` must be set")
9595
}
9696
for i, f := range y.Images {
@@ -176,8 +176,8 @@ func Validate(y *LimaYAML, warn bool) error {
176176
}
177177
}
178178

179-
if *y.SSH.Address == "127.0.0.1" && *y.VMType == EXT {
180-
return errors.New("field `ssh.address` must be set, for ext")
179+
if *y.SSH.Address == "127.0.0.1" && *y.VMType == STATIC {
180+
return errors.New("field `ssh.address` must be set")
181181
}
182182
if y.SSH.Address != nil {
183183
if err := validateHost("ssh.address", *y.SSH.Address); err != nil {
@@ -547,8 +547,8 @@ func warnExperimental(y *LimaYAML) {
547547
if *y.MountType == VIRTIOFS && runtime.GOOS == "linux" {
548548
logrus.Warn("`mountType: virtiofs` on Linux is experimental")
549549
}
550-
if *y.VMType == EXT {
551-
logrus.Warn("`vmType: ext` is experimental")
550+
if *y.VMType == STATIC {
551+
logrus.Warn("`vmType: static` is experimental")
552552
}
553553
if *y.Arch == RISCV64 {
554554
logrus.Warn("`arch: riscv64` is experimental")

pkg/static/static_driver.go

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package static
2+
3+
import (
4+
"github.com/lima-vm/lima/pkg/driver"
5+
)
6+
7+
type LimaStaticDriver struct {
8+
*driver.BaseDriver
9+
}
10+
11+
func New(driver *driver.BaseDriver) *LimaStaticDriver {
12+
return &LimaStaticDriver{
13+
BaseDriver: driver,
14+
}
15+
}

pkg/store/instance.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ func inspectStatusWithPIDFiles(instDir string, inst *Instance, y *limayaml.LimaY
189189
inst.Status = StatusBroken
190190
inst.Errors = append(inst.Errors, err)
191191
}
192-
if *y.VMType == limayaml.EXT {
192+
if *y.VMType == limayaml.STATIC {
193193
if inst.HostAgentPID > 0 {
194194
inst.Status = StatusRunning
195195
} else if inst.HostAgentPID == 0 {

templates/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ Distro:
3131
- [`experimental/gentoo`](./experimental/gentoo.yaml): [experimental] Gentoo
3232
- [`experimental/opensuse-tumbleweed`](./experimental/opensuse-tumbleweed.yaml): [experimental] openSUSE Tumbleweed
3333

34-
External:
35-
- [`experimental/ext`](./experimental/ext.yaml): [experimental] External Raspberry Pi Zero
34+
Static:
35+
- [`experimental/static`](./experimental/static.yaml): [experimental] Static Raspberry Pi Zero
3636

3737
Container engines:
3838
- [`apptainer`](./apptainer.yaml): Apptainer

templates/experimental/ext.yaml renamed to templates/experimental/static.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
vmType: ext
1+
vmType: static
22

33
arch: "aarch64"
44
cpus: 4

website/content/en/docs/config/vmtype.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Lima supports two ways of running guest machines:
77
- [qemu](#qemu)
88
- [vz](#vz)
99

10-
Lima also supports connecting to external machines:
11-
- [ext](#ext)
10+
Lima also supports connecting to static machines:
11+
- [static](#static)
1212

1313
The vmType can be specified only on creating the instance.
1414
The vmType of existing instances cannot be changed.
@@ -115,10 +115,10 @@ containerd:
115115
- WSL2 requires a `tar` formatted rootfs archive instead of a VM image
116116
- Windows doesn't ship with ssh.exe, gzip.exe, etc. which are used by Lima at various points. The easiest way around this is to run `winget install -e --id Git.MinGit` (winget is now built in to Windows as well), and add the resulting `C:\Program Files\Git\usr\bin\` directory to your path.
117117

118-
## EXT
118+
## STATIC
119119
> **Warning**
120-
> "ext" mode is experimental
120+
> "static" mode is experimental
121121

122-
"ext" option makes use of an external machine, either a virtual machine or a physical machine.
122+
"static" option makes use of an external machine, either a virtual machine or a physical machine.
123123

124124
It is accessed using an address (for SSH), the keys are supposed to be set up for it already.

0 commit comments

Comments
 (0)