From 102e004727c29072e43dd2c85db7716bdb8d6878 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Mon, 13 Jan 2025 19:37:36 +0100 Subject: all: support empty HTTP config We don't really need an HTTP server when running syz-manager during kernel image testing and when running syz-diff automatically. Don't require the config to be set and don't start the HTTP server in this case. --- tools/syz-diff/diff.go | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'tools/syz-diff') diff --git a/tools/syz-diff/diff.go b/tools/syz-diff/diff.go index 3707867ae..5e971b1be 100644 --- a/tools/syz-diff/diff.go +++ b/tools/syz-diff/diff.go @@ -87,18 +87,19 @@ func main() { new: new, store: store, reproAttempts: map[string]int{}, - http: &manager.HTTPServer{ + } + if newCfg.HTTP != "" { + diffCtx.http = &manager.HTTPServer{ Cfg: newCfg, StartTime: time.Now(), DiffStore: store, - }, - } - diffCtx.http.Pools = map[string]*vm.Dispatcher{ - new.name: new.pool, - base.name: base.pool, + Pools: map[string]*vm.Dispatcher{ + new.name: new.pool, + base.name: base.pool, + }, + } + new.http = diffCtx.http } - new.http = diffCtx.http - diffCtx.Loop(ctx) } @@ -116,7 +117,10 @@ type diffContext struct { func (dc *diffContext) Loop(ctx context.Context) { reproLoop := manager.NewReproLoop(dc, dc.new.pool.Total()-dc.new.cfg.FuzzingVMs, false) - dc.http.ReproLoop = reproLoop + if dc.http != nil { + dc.http.ReproLoop = reproLoop + go dc.http.Serve() + } go func() { // Let both base and patched instances somewhat progress in fuzzing before we take // VMs away for bug reproduction. @@ -128,10 +132,8 @@ func (dc *diffContext) Loop(ctx context.Context) { go dc.base.Loop() go dc.new.Loop() - go dc.http.Serve() runner := &reproRunner{done: make(chan reproRunnerResult, 2), kernel: dc.base} - rareStat := time.NewTicker(5 * time.Minute) for { select { -- cgit mrf-deployment