aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/host
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/host
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/host')
-rw-r--r--pkg/host/features.go63
1 files changed, 63 insertions, 0 deletions
diff --git a/pkg/host/features.go b/pkg/host/features.go
index 80f083a21..8a8629084 100644
--- a/pkg/host/features.go
+++ b/pkg/host/features.go
@@ -9,6 +9,7 @@ import (
"time"
"github.com/google/syzkaller/pkg/csource"
+ "github.com/google/syzkaller/pkg/flatrpc"
"github.com/google/syzkaller/pkg/log"
"github.com/google/syzkaller/pkg/osutil"
"github.com/google/syzkaller/prog"
@@ -50,6 +51,68 @@ func (features *Features) Supported() *Features {
return features
}
+func (features *Features) ToFlatRPC() flatrpc.Feature {
+ var result flatrpc.Feature
+ if features[FeatureCoverage].Enabled {
+ result |= flatrpc.FeatureCoverage
+ }
+ if features[FeatureComparisons].Enabled {
+ result |= flatrpc.FeatureComparisons
+ }
+ if features[FeatureExtraCoverage].Enabled {
+ result |= flatrpc.FeatureExtraCoverage
+ }
+ if features[FeatureDelayKcovMmap].Enabled {
+ result |= flatrpc.FeatureDelayKcovMmap
+ }
+ if features[FeatureSandboxSetuid].Enabled {
+ result |= flatrpc.FeatureSandboxSetuid
+ }
+ if features[FeatureSandboxNamespace].Enabled {
+ result |= flatrpc.FeatureSandboxNamespace
+ }
+ if features[FeatureSandboxAndroid].Enabled {
+ result |= flatrpc.FeatureSandboxAndroid
+ }
+ if features[FeatureFault].Enabled {
+ result |= flatrpc.FeatureFault
+ }
+ if features[FeatureLeak].Enabled {
+ result |= flatrpc.FeatureLeak
+ }
+ if features[FeatureNetInjection].Enabled {
+ result |= flatrpc.FeatureNetInjection
+ }
+ if features[FeatureNetDevices].Enabled {
+ result |= flatrpc.FeatureNetDevices
+ }
+ if features[FeatureKCSAN].Enabled {
+ result |= flatrpc.FeatureKCSAN
+ }
+ if features[FeatureDevlinkPCI].Enabled {
+ result |= flatrpc.FeatureDevlinkPCI
+ }
+ if features[FeatureNicVF].Enabled {
+ result |= flatrpc.FeatureNicVF
+ }
+ if features[FeatureUSBEmulation].Enabled {
+ result |= flatrpc.FeatureUSBEmulation
+ }
+ if features[FeatureVhciInjection].Enabled {
+ result |= flatrpc.FeatureVhciInjection
+ }
+ if features[FeatureWifiEmulation].Enabled {
+ result |= flatrpc.FeatureWifiEmulation
+ }
+ if features[Feature802154Emulation].Enabled {
+ result |= flatrpc.FeatureLRWPANEmulation
+ }
+ if features[FeatureSwap].Enabled {
+ result |= flatrpc.FeatureSwap
+ }
+ return result
+}
+
var checkFeature [numFeatures]func() string
func unconditionallyEnabled() string { return "" }