aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/repro
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2023-06-14 14:58:25 +0200
committerAleksandr Nogikh <wp32pw@gmail.com>2023-06-15 11:49:04 +0200
commit757d26edba7d7de8c564a87a262a0b1321ddf804 (patch)
treef78b5e053c0a61ef2771e130af410ee7ee1d40da /pkg/repro
parent90d4044eae0123561d6cf2f667a4bc3357d93e7a (diff)
all: support swap feature on Linux
If the feature is supported on the device, allocate a 128MB swap file after VM boot and activate it.
Diffstat (limited to 'pkg/repro')
-rw-r--r--pkg/repro/repro.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/repro/repro.go b/pkg/repro/repro.go
index 87b9eaa4c..9cfb28dd8 100644
--- a/pkg/repro/repro.go
+++ b/pkg/repro/repro.go
@@ -201,6 +201,9 @@ func createStartOptions(cfg *mgrconfig.Config, features *host.Features, crashTyp
if !features[host.Feature802154Emulation].Enabled {
opts.IEEE802154 = false
}
+ if !features[host.FeatureSwap].Enabled {
+ opts.Swap = false
+ }
}
return opts
}
@@ -817,6 +820,7 @@ var cSimplifies = append(progSimplifies, []Simplify{
opts.USB = false
opts.VhciInjection = false
opts.Wifi = false
+ opts.Swap = false
return true
},
func(opts *csource.Options) bool {
@@ -926,4 +930,11 @@ var cSimplifies = append(progSimplifies, []Simplify{
opts.Sysctl = false
return true
},
+ func(opts *csource.Options) bool {
+ if !opts.Swap {
+ return false
+ }
+ opts.Swap = false
+ return true
+ },
}...)