Skip to content

Commit 3f540c7

Browse files
committed
slirp: remove for Podman6
Signed-off-by: Lokesh Mandvekar <[email protected]>
1 parent e2967b5 commit 3f540c7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+91
-1470
lines changed

cmd/podman/common/completion.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,26 +1325,10 @@ func AutocompleteNetworkFlag(cmd *cobra.Command, _ []string, toComplete string)
13251325
"none": nil,
13261326
"host": nil,
13271327
"private": nil,
1328-
"slirp4netns:": func(s string) ([]string, cobra.ShellCompDirective) {
1329-
skv := keyValueCompletion{
1330-
"allow_host_loopback=": getBoolCompletion,
1331-
"cidr=": nil,
1332-
"enable_ipv6=": getBoolCompletion,
1333-
"mtu=": nil,
1334-
"outbound_addr=": nil,
1335-
"outbound_addr6=": nil,
1336-
"port_handler=": func(_ string) ([]string, cobra.ShellCompDirective) {
1337-
return []string{"rootlesskit", "slirp4netns"}, cobra.ShellCompDirectiveNoFileComp
1338-
},
1339-
}
1340-
return completeKeyValues(s, skv)
1341-
},
13421328
}
13431329

13441330
networks, _ := getNetworks(cmd, toComplete, completeDefault)
13451331
suggestions, dir := completeKeyValues(toComplete, kv)
1346-
// add slirp4netns here it does not work correct if we add it to the kv map
1347-
suggestions = append(suggestions, "slirp4netns")
13481332
return append(networks, suggestions...), dir
13491333
}
13501334

cmd/podman/root.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -583,12 +583,6 @@ func rootFlags(cmd *cobra.Command, podmanConfig *entities.PodmanConfig) {
583583
pFlags.StringVar(&podmanConfig.ConmonPath, conmonFlagName, "", "Path of the conmon binary")
584584
_ = cmd.RegisterFlagCompletionFunc(conmonFlagName, completion.AutocompleteDefault)
585585

586-
// TODO (6.0): --network-cmd-path is deprecated, remove this option with the next major release
587-
// We need to find all the places that use r.config.Engine.NetworkCmdPath and remove it
588-
networkCmdPathFlagName := "network-cmd-path"
589-
pFlags.StringVar(&podmanConfig.ContainersConf.Engine.NetworkCmdPath, networkCmdPathFlagName, podmanConfig.ContainersConfDefaultsRO.Engine.NetworkCmdPath, "Path to the command for configuring the network")
590-
_ = cmd.RegisterFlagCompletionFunc(networkCmdPathFlagName, completion.AutocompleteDefault)
591-
592586
networkConfigDirFlagName := "network-config-dir"
593587
pFlags.StringVar(&podmanConfig.ContainersConf.Network.NetworkConfigDir, networkConfigDirFlagName, podmanConfig.ContainersConfDefaultsRO.Network.NetworkConfigDir, "Path of the configuration directory for networks")
594588
_ = cmd.RegisterFlagCompletionFunc(networkConfigDirFlagName, completion.AutocompleteDefault)

cmd/podman/system/service_abi.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ func restService(flags *pflag.FlagSet, cfg *entities.PodmanConfig, opts entities
125125

126126
maybeMoveToSubCgroup()
127127

128-
maybeStartServiceReaper()
129128
infra.StartWatcher(libpodRuntime)
130129
server, err := api.NewServerWithSettings(libpodRuntime, listener, opts)
131130
if err != nil {

cmd/podman/system/service_abi_common.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,5 @@
22

33
package system
44

5-
// Currently, we only need servicereaper on Linux to support slirp4netns.
6-
func maybeStartServiceReaper() {
7-
}
8-
95
// There is no cgroup on non linux.
106
func maybeMoveToSubCgroup() {}

cmd/podman/system/service_abi_linux.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,8 @@ import (
66
"github.com/containers/podman/v5/pkg/rootless"
77
"github.com/sirupsen/logrus"
88
"go.podman.io/common/pkg/cgroups"
9-
"go.podman.io/common/pkg/servicereaper"
109
)
1110

12-
// Currently, we only need servicereaper on Linux to support slirp4netns.
13-
func maybeStartServiceReaper() {
14-
servicereaper.Start()
15-
}
16-
1711
func maybeMoveToSubCgroup() {
1812
cgroupv2, _ := cgroups.IsCgroup2UnifiedMode()
1913
if rootless.IsRootless() && !cgroupv2 {

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ require (
5555
github.com/opencontainers/runtime-spec v1.2.1
5656
github.com/opencontainers/runtime-tools v0.9.1-0.20250523060157-0ea5ed0382a2
5757
github.com/opencontainers/selinux v1.12.0
58-
github.com/openshift/imagebuilder v1.2.17
58+
github.com/openshift/imagebuilder v1.2.19
5959
github.com/rootless-containers/rootlesskit/v2 v2.3.5
6060
github.com/shirou/gopsutil/v4 v4.25.9
6161
github.com/sirupsen/logrus v1.9.3
@@ -193,6 +193,6 @@ require (
193193
tags.cncf.io/container-device-interface/specs-go v1.0.0 // indirect
194194
)
195195

196-
replace go.podman.io/common => github.com/lsm5/container-libs/common v0.0.0-20251017191154-e63ca540eafe
196+
replace go.podman.io/common => github.com/lsm5/container-libs/common v0.0.0-20251021180701-90bb6920858f
197197

198-
replace github.com/containers/buildah => github.com/lsm5/buildah v0.0.0-20251017145416-1c35ea0ae809
198+
replace github.com/containers/buildah => github.com/lsm5/buildah v0.0.0-20251021181103-9374d7fa4e33

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,10 @@ github.com/letsencrypt/boulder v0.0.0-20240620165639-de9c06129bec h1:2tTW6cDth2T
233233
github.com/letsencrypt/boulder v0.0.0-20240620165639-de9c06129bec/go.mod h1:TmwEoGCwIti7BCeJ9hescZgRtatxRE+A72pCoPfmcfk=
234234
github.com/linuxkit/virtsock v0.0.0-20241009230534-cb6a20cc0422 h1:XvRuyDDRvi+UDxHN/M4MW4HxjmNVMmUKQj/+AbgsYgk=
235235
github.com/linuxkit/virtsock v0.0.0-20241009230534-cb6a20cc0422/go.mod h1:JLgfq4XMVbvfNlAXla/41lZnp21O72a/wWHGJefAvgQ=
236-
github.com/lsm5/buildah v0.0.0-20251017145416-1c35ea0ae809 h1:Xl7p6J9gfYA7TX0Z7VTNygqpEq7MZdrLX+EhsUdUOPc=
237-
github.com/lsm5/buildah v0.0.0-20251017145416-1c35ea0ae809/go.mod h1:DOj6mclvkxcijXOmZTybYPZpuDv5ZyqoyjZSwfs/ikk=
238-
github.com/lsm5/container-libs/common v0.0.0-20251017191154-e63ca540eafe h1:3zW0BFHDhdhVqZzxLJ0/TqDDkDET+/MPAQZNlvcZLkY=
239-
github.com/lsm5/container-libs/common v0.0.0-20251017191154-e63ca540eafe/go.mod h1:aNd2a0S7pY+fx1X5kpQYuF4hbwLU8ZOccuVrhu7h1Xc=
236+
github.com/lsm5/buildah v0.0.0-20251021181103-9374d7fa4e33 h1:imgY+jsruSreNEA5GW7tXcULJ1JFMjdm49XV2JDBMmY=
237+
github.com/lsm5/buildah v0.0.0-20251021181103-9374d7fa4e33/go.mod h1:t9rFEW8WJROZ2Ir1lkCit0jJuH9LN34Pe7W9fVP8iK4=
238+
github.com/lsm5/container-libs/common v0.0.0-20251021180701-90bb6920858f h1:74iytTBu5OWCtoF5q1eO0uDyJTn/um68tPfgexNFl3U=
239+
github.com/lsm5/container-libs/common v0.0.0-20251021180701-90bb6920858f/go.mod h1:aNd2a0S7pY+fx1X5kpQYuF4hbwLU8ZOccuVrhu7h1Xc=
240240
github.com/lufia/plan9stats v0.0.0-20240909124753-873cd0166683 h1:7UMa6KCCMjZEMDtTVdcGu0B1GmmC7QJKiCCjyTAWQy0=
241241
github.com/lufia/plan9stats v0.0.0-20240909124753-873cd0166683/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k=
242242
github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA=
@@ -316,8 +316,8 @@ github.com/opencontainers/runtime-tools v0.9.1-0.20250523060157-0ea5ed0382a2 h1:
316316
github.com/opencontainers/runtime-tools v0.9.1-0.20250523060157-0ea5ed0382a2/go.mod h1:MXdPzqAA8pHC58USHqNCSjyLnRQ6D+NjbpP+02Z1U/0=
317317
github.com/opencontainers/selinux v1.12.0 h1:6n5JV4Cf+4y0KNXW48TLj5DwfXpvWlxXplUkdTrmPb8=
318318
github.com/opencontainers/selinux v1.12.0/go.mod h1:BTPX+bjVbWGXw7ZZWUbdENt8w0htPSrlgOOysQaU62U=
319-
github.com/openshift/imagebuilder v1.2.17 h1:xusHiBvK7PpBsEeMGTg61Zx5kSajybjUAbBzVEJKH6g=
320-
github.com/openshift/imagebuilder v1.2.17/go.mod h1:I9FlC4LVo0z/8GM8wdWVhxmw3tUVNM6tiwb8tRv4jvQ=
319+
github.com/openshift/imagebuilder v1.2.19 h1:Xqq36KMJgsRU2MPaLRML23Myvk+AaY8pE8VJ6m6Vmy4=
320+
github.com/openshift/imagebuilder v1.2.19/go.mod h1:fdbnfQWjxMBoB/jrvEzUk+UT1zqvtZZj7oQ7GU6RD9I=
321321
github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ=
322322
github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
323323
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=

libpod/container.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,6 @@ type Container struct {
107107
runtime *Runtime
108108
ociRuntime OCIRuntime
109109

110-
rootlessSlirpSyncR *os.File
111-
rootlessSlirpSyncW *os.File
112-
113110
rootlessPortSyncR *os.File
114111
rootlessPortSyncW *os.File
115112

@@ -126,8 +123,7 @@ type Container struct {
126123
// This is true if a container is restored from a checkpoint.
127124
restoreFromCheckpoint bool
128125

129-
slirp4netnsSubnet *net.IPNet
130-
pastaResult *pasta.SetupResult
126+
pastaResult *pasta.SetupResult
131127
}
132128

133129
// ContainerState contains the current state of the container

libpod/container_api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ func (c *Container) Sync() error {
928928
// reloaded, and existing rules have been wiped out. It is expected that some
929929
// downtime will result, as the rules are destroyed as part of this process.
930930
// At present, this only works on root containers; it may be expanded to restart
931-
// slirp4netns in the future to work with rootless containers as well.
931+
// pasta(?) in the future to work with rootless containers as well.
932932
// Requires that the container must be running or created.
933933
func (c *Container) ReloadNetwork() error {
934934
if !c.batched {

libpod/container_internal_common.go

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2262,7 +2262,7 @@ func (c *Container) addResolvConf() error {
22622262
// add the nameservers from the networks status
22632263
nameservers = networkNameServers
22642264
} else {
2265-
// pasta and slirp4netns have a built in DNS forwarder.
2265+
// pasta has a built in DNS forwarder.
22662266
nameservers = c.addSpecialDNS(nameservers)
22672267
}
22682268
}
@@ -2317,12 +2317,7 @@ func (c *Container) checkForIPv6(netStatus map[string]types.StatusBlock) bool {
23172317
}
23182318
}
23192319
}
2320-
2321-
if c.pastaResult != nil {
2322-
return c.pastaResult.IPv6
2323-
}
2324-
2325-
return c.isSlirp4netnsIPv6()
2320+
return c.pastaResult.IPv6
23262321
}
23272322

23282323
// Add a new nameserver to the container's resolv.conf, ensuring that it is the
@@ -2384,12 +2379,6 @@ func (c *Container) getHostsEntries() (etchosts.HostEntries, error) {
23842379
if len(c.pastaResult.IPAddresses) > 0 {
23852380
entries = etchosts.HostEntries{{IP: c.pastaResult.IPAddresses[0].String(), Names: names}}
23862381
}
2387-
case c.config.NetMode.IsSlirp4netns():
2388-
ip, err := getSlirp4netnsIP(c.slirp4netnsSubnet)
2389-
if err != nil {
2390-
return nil, err
2391-
}
2392-
entries = etchosts.HostEntries{{IP: ip.String(), Names: names}}
23932382
default:
23942383
if c.hasNetNone() {
23952384
entries = etchosts.HostEntries{{IP: "127.0.0.1", Names: names}}

0 commit comments

Comments
 (0)