aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource/options.go
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2019-10-24 10:16:19 +0200
committerDmitry Vyukov <dvyukov@google.com>2019-11-03 14:20:59 +0100
commitd40d75d2d787b9d4f949422b88de18ede4ee20b6 (patch)
tree18713cd0e1884616ceee1c74381eba65419aff9f /pkg/csource/options.go
parent97f4b019d87a073ff02a3ff8b08ada59aea6e688 (diff)
executor: move fixed pci devlink handle into network namespace
In case there is a fixed pci devlink handle "pci/pci/0000:00:10.0" on the system (initial network namespace), it is moved to a working network namespace. Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Diffstat (limited to 'pkg/csource/options.go')
-rw-r--r--pkg/csource/options.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/pkg/csource/options.go b/pkg/csource/options.go
index 7ad8c1d9c..a4cc45d45 100644
--- a/pkg/csource/options.go
+++ b/pkg/csource/options.go
@@ -38,6 +38,7 @@ type Options struct {
EnableBinfmtMisc bool `json:"binfmt_misc,omitempty"`
EnableCloseFds bool `json:"close_fds"`
EnableKCSAN bool `json:"kcsan,omitempty"`
+ EnableDevlinkPCI bool `json:"devlinkpci,omitempty"`
UseTmpDir bool `json:"tmpdir,omitempty"`
HandleSegv bool `json:"segv,omitempty"`
@@ -127,6 +128,9 @@ func (opts Options) checkLinuxOnly(OS string) error {
if opts.EnableKCSAN {
return fmt.Errorf("option EnableKCSAN is not supported on %v", OS)
}
+ if opts.EnableDevlinkPCI {
+ return fmt.Errorf("option EnableDevlinkPCI is not supported on %v", OS)
+ }
if opts.Sandbox == sandboxNamespace ||
(opts.Sandbox == sandboxSetuid && !(OS == openbsd || OS == freebsd || OS == netbsd)) ||
opts.Sandbox == sandboxAndroidUntrustedApp {
@@ -154,6 +158,7 @@ func DefaultOpts(cfg *mgrconfig.Config) Options {
EnableCgroups: true,
EnableBinfmtMisc: true,
EnableCloseFds: true,
+ EnableDevlinkPCI: true,
UseTmpDir: true,
HandleSegv: true,
Repro: true,
@@ -165,6 +170,12 @@ func DefaultOpts(cfg *mgrconfig.Config) Options {
opts.EnableCgroups = false
opts.EnableBinfmtMisc = false
opts.EnableCloseFds = false
+ opts.EnableDevlinkPCI = false
+ }
+ if cfg.Sandbox == "" || cfg.Sandbox == "setuid" {
+ opts.EnableNetReset = false
+ }
+ if err := opts.Check(cfg.TargetOS); err != nil {
}
if cfg.Sandbox == "" || cfg.Sandbox == "setuid" {
opts.EnableNetReset = false
@@ -244,6 +255,7 @@ func defaultFeatures(value bool) Features {
"cgroups": {"setup cgroups for testing", value},
"binfmt_misc": {"setup binfmt_misc for testing", value},
"close_fds": {"close fds after each program", value},
+ "devlink_pci": {"setup devlink PCI device", value},
}
}