From 6410b21bc162fd5f9527bda7484828c53cd872d0 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 7 Nov 2024 16:01:00 +0100 Subject: pkg/manager: set more http fields before calling Serve Pools and ReproLoop and always created on start, so there is no need to support lazy set for them. It only complicates code and makes it harder to reason about. Also introduce vm.Dispatcher as an alias to dispatcher.Pool, as it's the only specialization we use in the project. --- tools/syz-diff/diff.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'tools/syz-diff') diff --git a/tools/syz-diff/diff.go b/tools/syz-diff/diff.go index 6a6a0991d..c3da6c8ec 100644 --- a/tools/syz-diff/diff.go +++ b/tools/syz-diff/diff.go @@ -93,8 +93,10 @@ func main() { DiffStore: store, }, } - diffCtx.http.Pools.Store(new.name, new.pool) - diffCtx.http.Pools.Store(base.name, base.pool) + diffCtx.http.Pools = map[string]*vm.Dispatcher{ + new.name: new.pool, + base.name: base.pool, + } new.http = diffCtx.http diffCtx.Loop(ctx) @@ -114,7 +116,7 @@ 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.Store(reproLoop) + dc.http.ReproLoop = reproLoop go func() { // Let both base and patched instances somewhat progress in fuzzing before we take // VMs away for bug reproduction. @@ -235,7 +237,7 @@ type kernelContext struct { serv rpcserver.Server servStats rpcserver.Stats crashes chan *report.Report - pool *dispatcher.Pool[*vm.Instance] + pool *vm.Dispatcher features flatrpc.Feature candidates chan []fuzzer.Candidate -- cgit mrf-deployment