From c9aa7b7def60823283a7fd261940c0a05d3ce850 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Fri, 12 Jan 2024 11:43:20 +0100 Subject: syz-ci: support global per-vm-type configs This will help prevent many repetitions in our syz-ci configs. --- syz-ci/syz-ci.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'syz-ci') diff --git a/syz-ci/syz-ci.go b/syz-ci/syz-ci.go index e1408c64e..6eb62bba4 100644 --- a/syz-ci/syz-ci.go +++ b/syz-ci/syz-ci.go @@ -133,6 +133,9 @@ type Config struct { CommitPollPeriod int `json:"commit_poll_period"` // Asset Storage config. AssetStorage *asset.Config `json:"asset_storage"` + // Per-vm type JSON diffs that will be applied to every instace of the + // corresponding VM type. + PatchVMConfigs map[string]json.RawMessage `json:"patch_vm_configs"` } type ManagerConfig struct { @@ -457,6 +460,13 @@ func loadManagerConfig(cfg *Config, mgr *ManagerConfig) error { if mgr.KernelConfig != "" && mgr.KernelBaselineConfig == "" { mgr.KernelBaselineConfig = inferBaselineConfig(mgr.KernelConfig) } + + if cfg.PatchVMConfigs[managercfg.Type] != nil { + managercfg.VM, err = config.MergeJSONs(managercfg.VM, cfg.PatchVMConfigs[managercfg.Type]) + if err != nil { + return fmt.Errorf("failed to patch manager %v's VM: %w", mgr.Name, err) + } + } return nil } -- cgit mrf-deployment