Skip to content

Commit dedb310

Browse files
committed
mantle: Drop 9p support
Per request to avoid carrying it as tech debt.
1 parent b91594c commit dedb310

File tree

3 files changed

+7
-30
lines changed

3 files changed

+7
-30
lines changed

mantle/cmd/kola/qemuexec.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ func runQemuExec(cmd *cobra.Command, args []string) error {
296296
}
297297
builder.MountHost(src, dest, true)
298298
ensureConfig()
299-
config.MountHost(dest, builder.UseVirtiofs, true)
299+
config.MountHost(dest, true)
300300
}
301301
for _, b := range bindrw {
302302
src, dest, err := parseBindOpt(b)
@@ -305,7 +305,7 @@ func runQemuExec(cmd *cobra.Command, args []string) error {
305305
}
306306
builder.MountHost(src, dest, false)
307307
ensureConfig()
308-
config.MountHost(dest, builder.UseVirtiofs, false)
308+
config.MountHost(dest, false)
309309
}
310310
builder.ForceConfigInjection = forceConfigInjection
311311
if len(firstbootkargs) > 0 {

mantle/platform/conf/conf.go

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,21 +1363,11 @@ PROMPT_COMMAND+=(resize_terminal)`, 0644)
13631363
}
13641364

13651365
// MountHost adds an Ignition config to mount an folder
1366-
func (c *Conf) MountHost(dest string, virtiofs, readonly bool) {
1366+
func (c *Conf) MountHost(dest string, readonly bool) {
13671367
mountType := "virtiofs"
1368-
if !virtiofs {
1369-
mountType = "9p"
1370-
}
13711368
options := ""
1372-
if virtiofs {
1373-
if readonly {
1374-
options = "ro"
1375-
}
1376-
} else {
1377-
options = "trans=virtio,version=9p2000.L,msize=10485760"
1378-
if readonly {
1379-
options += ",ro"
1380-
}
1369+
if readonly {
1370+
options = "ro"
13811371
}
13821372
content := fmt.Sprintf(`[Unit]
13831373
DefaultDependencies=no

mantle/platform/qemu.go

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,6 @@ type QemuBuilder struct {
477477
ignitionSet bool
478478
ignitionRendered bool
479479

480-
// UseVirtiofs should be true if mounts use virtiofs (default: 9p)
481-
UseVirtiofs bool
482480
UsermodeNetworking bool
483481
RestrictNetworking bool
484482
requestedHostForwardPorts []HostForwardPort
@@ -510,14 +508,12 @@ func NewQemuBuilder() *QemuBuilder {
510508
default:
511509
defaultFirmware = ""
512510
}
513-
_, use9P := os.LookupEnv("COSA_9P_FALLBACK")
514511
ret := QemuBuilder{
515512
Firmware: defaultFirmware,
516513
Swtpm: true,
517514
Pdeathsig: true,
518515
Argv: []string{},
519516
architecture: coreosarch.CurrentRpmArch(),
520-
UseVirtiofs: !use9P,
521517
}
522518
return &ret
523519
}
@@ -1787,8 +1783,8 @@ func (builder *QemuBuilder) Exec() (*QemuInstance, error) {
17871783
return nil, err
17881784
}
17891785

1790-
// Process 9p/virtiofs mounts
1791-
if len(builder.hostMounts) > 0 && builder.UseVirtiofs {
1786+
// Process virtiofs mounts
1787+
if len(builder.hostMounts) > 0 {
17921788
if err := builder.ensureTempdir(); err != nil {
17931789
return nil, err
17941790
}
@@ -1847,15 +1843,6 @@ func (builder *QemuBuilder) Exec() (*QemuInstance, error) {
18471843
if err != nil {
18481844
return nil, err
18491845
}
1850-
} else if len(builder.hostMounts) > 0 {
1851-
for i, hostmnt := range builder.hostMounts {
1852-
readonlyStr := ""
1853-
if hostmnt.readonly {
1854-
readonlyStr = ",readonly=on"
1855-
}
1856-
builder.Append("--fsdev", fmt.Sprintf("local,id=fs%d,path=%s,security_model=mapped%s", i, hostmnt.src, readonlyStr))
1857-
builder.Append("-device", virtio(builder.architecture, "9p", fmt.Sprintf("fsdev=fs%d,mount_tag=%s", i, hostmnt.dest)))
1858-
}
18591846
}
18601847

18611848
fdnum := 3 // first additional file starts at position 3

0 commit comments

Comments
 (0)