@@ -43,9 +43,9 @@ func New(driver *driver.BaseDriver) *LimaQemuDriver {
43
43
}
44
44
45
45
func (l * LimaQemuDriver ) Validate () error {
46
- if * l .InstConfig .MountType == limayaml .VIRTIOFS && runtime .GOOS != "linux" {
46
+ if * l .Instance . Config .MountType == limayaml .VIRTIOFS && runtime .GOOS != "linux" {
47
47
return fmt .Errorf ("field `mountType` must be %q or %q for QEMU driver on non-Linux, got %q" ,
48
- limayaml .REVSSHFS , limayaml .NINEP , * l .InstConfig .MountType )
48
+ limayaml .REVSSHFS , limayaml .NINEP , * l .Instance . Config .MountType )
49
49
}
50
50
return nil
51
51
}
@@ -54,7 +54,7 @@ func (l *LimaQemuDriver) CreateDisk(ctx context.Context) error {
54
54
qCfg := Config {
55
55
Name : l .Instance .Name ,
56
56
InstanceDir : l .Instance .Dir ,
57
- LimaYAML : l .InstConfig ,
57
+ LimaYAML : l .Instance . Config ,
58
58
}
59
59
return EnsureDisk (ctx , qCfg )
60
60
}
@@ -70,7 +70,7 @@ func (l *LimaQemuDriver) Start(ctx context.Context) (chan error, error) {
70
70
qCfg := Config {
71
71
Name : l .Instance .Name ,
72
72
InstanceDir : l .Instance .Dir ,
73
- LimaYAML : l .InstConfig ,
73
+ LimaYAML : l .Instance . Config ,
74
74
SSHLocalPort : l .SSHLocalPort ,
75
75
}
76
76
qExe , qArgs , err := Cmdline (ctx , qCfg )
@@ -79,13 +79,13 @@ func (l *LimaQemuDriver) Start(ctx context.Context) (chan error, error) {
79
79
}
80
80
81
81
var vhostCmds []* exec.Cmd
82
- if * l .InstConfig .MountType == limayaml .VIRTIOFS {
82
+ if * l .Instance . Config .MountType == limayaml .VIRTIOFS {
83
83
vhostExe , err := FindVirtiofsd (qExe )
84
84
if err != nil {
85
85
return nil , err
86
86
}
87
87
88
- for i := range l .InstConfig .Mounts {
88
+ for i := range l .Instance . Config .Mounts {
89
89
args , err := VirtiofsdCmdline (qCfg , i )
90
90
if err != nil {
91
91
return nil , err
@@ -189,8 +189,8 @@ func (l *LimaQemuDriver) Start(ctx context.Context) (chan error, error) {
189
189
}()
190
190
l .vhostCmds = vhostCmds
191
191
go func () {
192
- if usernetIndex := limayaml .FirstUsernetIndex (l .InstConfig ); usernetIndex != - 1 {
193
- client := usernet .NewClientByName (l .InstConfig .Networks [usernetIndex ].Lima )
192
+ if usernetIndex := limayaml .FirstUsernetIndex (l .Instance . Config ); usernetIndex != - 1 {
193
+ client := usernet .NewClientByName (l .Instance . Config .Networks [usernetIndex ].Lima )
194
194
err := client .ConfigureDriver (ctx , l .BaseDriver )
195
195
if err != nil {
196
196
l .qWaitCh <- err
@@ -297,8 +297,8 @@ func (l *LimaQemuDriver) killVhosts() error {
297
297
298
298
func (l * LimaQemuDriver ) shutdownQEMU (ctx context.Context , timeout time.Duration , qCmd * exec.Cmd , qWaitCh <- chan error ) error {
299
299
logrus .Info ("Shutting down QEMU with ACPI" )
300
- if usernetIndex := limayaml .FirstUsernetIndex (l .InstConfig ); usernetIndex != - 1 {
301
- client := usernet .NewClientByName (l .InstConfig .Networks [usernetIndex ].Lima )
300
+ if usernetIndex := limayaml .FirstUsernetIndex (l .Instance . Config ); usernetIndex != - 1 {
301
+ client := usernet .NewClientByName (l .Instance . Config .Networks [usernetIndex ].Lima )
302
302
err := client .UnExposeSSH (l .SSHLocalPort )
303
303
if err != nil {
304
304
logrus .Warnf ("Failed to remove SSH binding for port %d" , l .SSHLocalPort )
@@ -348,7 +348,7 @@ func (l *LimaQemuDriver) killQEMU(_ context.Context, _ time.Duration, qCmd *exec
348
348
} else {
349
349
logrus .Info ("QEMU has already exited" )
350
350
}
351
- qemuPIDPath := filepath .Join (l .Instance .Dir , filenames .PIDFile (* l .InstConfig .VMType ))
351
+ qemuPIDPath := filepath .Join (l .Instance .Dir , filenames .PIDFile (* l .Instance . Config .VMType ))
352
352
_ = os .RemoveAll (qemuPIDPath )
353
353
_ = l .removeVNCFiles ()
354
354
return errors .Join (qWaitErr , l .killVhosts ())
@@ -366,7 +366,7 @@ func (l *LimaQemuDriver) DeleteSnapshot(_ context.Context, tag string) error {
366
366
qCfg := Config {
367
367
Name : l .Instance .Name ,
368
368
InstanceDir : l .Instance .Dir ,
369
- LimaYAML : l .InstConfig ,
369
+ LimaYAML : l .Instance . Config ,
370
370
}
371
371
return Del (qCfg , l .Instance .Status == store .StatusRunning , tag )
372
372
}
@@ -375,7 +375,7 @@ func (l *LimaQemuDriver) CreateSnapshot(_ context.Context, tag string) error {
375
375
qCfg := Config {
376
376
Name : l .Instance .Name ,
377
377
InstanceDir : l .Instance .Dir ,
378
- LimaYAML : l .InstConfig ,
378
+ LimaYAML : l .Instance . Config ,
379
379
}
380
380
return Save (qCfg , l .Instance .Status == store .StatusRunning , tag )
381
381
}
@@ -384,7 +384,7 @@ func (l *LimaQemuDriver) ApplySnapshot(_ context.Context, tag string) error {
384
384
qCfg := Config {
385
385
Name : l .Instance .Name ,
386
386
InstanceDir : l .Instance .Dir ,
387
- LimaYAML : l .InstConfig ,
387
+ LimaYAML : l .Instance . Config ,
388
388
}
389
389
return Load (qCfg , l .Instance .Status == store .StatusRunning , tag )
390
390
}
@@ -393,7 +393,7 @@ func (l *LimaQemuDriver) ListSnapshots(_ context.Context) (string, error) {
393
393
qCfg := Config {
394
394
Name : l .Instance .Name ,
395
395
InstanceDir : l .Instance .Dir ,
396
- LimaYAML : l .InstConfig ,
396
+ LimaYAML : l .Instance . Config ,
397
397
}
398
398
return List (qCfg , l .Instance .Status == store .StatusRunning )
399
399
}
0 commit comments