Skip to content

Commit c3e82cc

Browse files
authored
Merge pull request #1164 from AkihiroSuda/dev2
vz: fix readonly mounts
2 parents 678e32f + 9857eb3 commit c3e82cc

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

pkg/cidata/cidata.go

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -166,19 +166,22 @@ func GenerateISO9660(instDir, name string, y *limayaml.LimaYAML, udpDNSLocalPort
166166
return err
167167
}
168168
options := "defaults"
169-
if fstype == "9p" {
169+
switch fstype {
170+
case "9p", "virtiofs":
170171
options = "ro"
171172
if *f.Writable {
172173
options = "rw"
173174
}
174-
options += ",trans=virtio"
175-
options += fmt.Sprintf(",version=%s", *f.NineP.ProtocolVersion)
176-
msize, err := units.RAMInBytes(*f.NineP.Msize)
177-
if err != nil {
178-
return fmt.Errorf("failed to parse msize for %q: %w", location, err)
175+
if fstype == "9p" {
176+
options += ",trans=virtio"
177+
options += fmt.Sprintf(",version=%s", *f.NineP.ProtocolVersion)
178+
msize, err := units.RAMInBytes(*f.NineP.Msize)
179+
if err != nil {
180+
return fmt.Errorf("failed to parse msize for %q: %w", location, err)
181+
}
182+
options += fmt.Sprintf(",msize=%d", msize)
183+
options += fmt.Sprintf(",cache=%s", *f.NineP.Cache)
179184
}
180-
options += fmt.Sprintf(",msize=%d", msize)
181-
options += fmt.Sprintf(",cache=%s", *f.NineP.Cache)
182185
// don't fail the boot, if virtfs is not available
183186
options += ",nofail"
184187
}

0 commit comments

Comments
 (0)