Skip to content

Commit 0b65a14

Browse files
authored
Merge pull request #1642 from AkihiroSuda/silence-virtio-queueSize
Silence "field mounts[%d].virtiofs.queueSize is only supported on Linux" when it is not specified
2 parents e4964df + 8b7bab1 commit 0b65a14

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

pkg/limayaml/defaults.go

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,21 @@ func FillDefault(y, d, o *LimaYAML, filePath string) {
489489
}
490490
}
491491

492+
// MountType has to be resolved before resolving Mounts
493+
if y.MountType == nil {
494+
y.MountType = d.MountType
495+
}
496+
if o.MountType != nil {
497+
y.MountType = o.MountType
498+
}
499+
if y.MountType == nil || *y.MountType == "" {
500+
if *y.VMType == VZ {
501+
y.MountType = pointer.String(VIRTIOFS)
502+
} else {
503+
y.MountType = pointer.String(REVSSHFS)
504+
}
505+
}
506+
492507
// Combine all mounts; highest priority entry determines writable status.
493508
// Only works for exact matches; does not normalize case or resolve symlinks.
494509
mounts := make([]Mount, 0, len(d.Mounts)+len(y.Mounts)+len(o.Mounts))
@@ -552,7 +567,7 @@ func FillDefault(y, d, o *LimaYAML, filePath string) {
552567
if mount.NineP.Msize == nil {
553568
mounts[i].NineP.Msize = pointer.String(Default9pMsize)
554569
}
555-
if mount.Virtiofs.QueueSize == nil {
570+
if mount.Virtiofs.QueueSize == nil && *y.VMType == QEMU && *y.MountType == VIRTIOFS {
556571
mounts[i].Virtiofs.QueueSize = pointer.Int(DefaultVirtiofsQueueSize)
557572
}
558573
if mount.Writable == nil {
@@ -570,20 +585,6 @@ func FillDefault(y, d, o *LimaYAML, filePath string) {
570585
}
571586
}
572587

573-
if y.MountType == nil {
574-
y.MountType = d.MountType
575-
}
576-
if o.MountType != nil {
577-
y.MountType = o.MountType
578-
}
579-
if y.MountType == nil || *y.MountType == "" {
580-
if *y.VMType == VZ {
581-
y.MountType = pointer.String(VIRTIOFS)
582-
} else {
583-
y.MountType = pointer.String(REVSSHFS)
584-
}
585-
}
586-
587588
// Note: DNS lists are not combined; highest priority setting is picked
588589
if len(y.DNS) == 0 {
589590
y.DNS = d.DNS

0 commit comments

Comments
 (0)