From 757d26edba7d7de8c564a87a262a0b1321ddf804 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Wed, 14 Jun 2023 14:58:25 +0200 Subject: 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. --- pkg/repro/repro.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'pkg/repro') 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 + }, }...) -- cgit mrf-deployment