aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/ipc
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2024-05-06 13:10:47 +0200
committerDmitry Vyukov <dvyukov@google.com>2024-05-06 16:25:33 +0000
commit3f94021ec61c81270e948abb0efe7da66ace3d5a (patch)
tree886841b7b3e809f10927815263f3feecdebdaaa7 /pkg/ipc
parentc035c6de7b75d2ca88982bf059fd4e27cbad7a26 (diff)
pkg/repro, pkg/ipc: use flatrpc.Feature
Start switching from host.Features to flatrpc.Features. This change is supposed to be a no-op, just to reduce future diffs that will change how we obtain features.
Diffstat (limited to 'pkg/ipc')
-rw-r--r--pkg/ipc/ipc.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/pkg/ipc/ipc.go b/pkg/ipc/ipc.go
index 6185a6181..79b2acc18 100644
--- a/pkg/ipc/ipc.go
+++ b/pkg/ipc/ipc.go
@@ -18,7 +18,7 @@ import (
"github.com/google/syzkaller/pkg/cover"
"github.com/google/syzkaller/pkg/csource"
- "github.com/google/syzkaller/pkg/host"
+ "github.com/google/syzkaller/pkg/flatrpc"
"github.com/google/syzkaller/pkg/osutil"
"github.com/google/syzkaller/pkg/signal"
"github.com/google/syzkaller/prog"
@@ -158,7 +158,7 @@ func FlagsToSandbox(flags EnvFlags) string {
}
// nolint: gocyclo
-func FeaturesToFlags(feat *host.Features, manual csource.Features) EnvFlags {
+func FeaturesToFlags(features flatrpc.Feature, manual csource.Features) EnvFlags {
var flags EnvFlags
if manual == nil || manual["net_reset"].Enabled {
flags |= FlagEnableNetReset
@@ -169,28 +169,28 @@ func FeaturesToFlags(feat *host.Features, manual csource.Features) EnvFlags {
if manual == nil || manual["close_fds"].Enabled {
flags |= FlagEnableCloseFds
}
- if feat[host.FeatureExtraCoverage].Enabled {
+ if features&flatrpc.FeatureExtraCoverage != 0 {
flags |= FlagExtraCover
}
- if feat[host.FeatureDelayKcovMmap].Enabled {
+ if features&flatrpc.FeatureDelayKcovMmap != 0 {
flags |= FlagDelayKcovMmap
}
- if feat[host.FeatureNetInjection].Enabled && (manual == nil || manual["tun"].Enabled) {
+ if features&flatrpc.FeatureNetInjection != 0 && (manual == nil || manual["tun"].Enabled) {
flags |= FlagEnableTun
}
- if feat[host.FeatureNetDevices].Enabled && (manual == nil || manual["net_dev"].Enabled) {
+ if features&flatrpc.FeatureNetDevices != 0 && (manual == nil || manual["net_dev"].Enabled) {
flags |= FlagEnableNetDev
}
- if feat[host.FeatureDevlinkPCI].Enabled && (manual == nil || manual["devlink_pci"].Enabled) {
+ if features&flatrpc.FeatureDevlinkPCI != 0 && (manual == nil || manual["devlink_pci"].Enabled) {
flags |= FlagEnableDevlinkPCI
}
- if feat[host.FeatureNicVF].Enabled && (manual == nil || manual["nic_vf"].Enabled) {
+ if features&flatrpc.FeatureNicVF != 0 && (manual == nil || manual["nic_vf"].Enabled) {
flags |= FlagEnableNicVF
}
- if feat[host.FeatureVhciInjection].Enabled && (manual == nil || manual["vhci"].Enabled) {
+ if features&flatrpc.FeatureVhciInjection != 0 && (manual == nil || manual["vhci"].Enabled) {
flags |= FlagEnableVhciInjection
}
- if feat[host.FeatureWifiEmulation].Enabled && (manual == nil || manual["wifi"].Enabled) {
+ if features&flatrpc.FeatureWifiEmulation != 0 && (manual == nil || manual["wifi"].Enabled) {
flags |= FlagEnableWifi
}
return flags