From 0cdd36fc443630fa8b6c5d7903cb7adc0baac5b5 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 27 May 2024 17:29:36 +0200 Subject: sys/targets: add consts for gvisor/starnix Lint started warning about duplicate "gvisor" const in pkg/cover. Add gvisor/starnix consts to sys/targets package to avoid duplication. --- vm/gvisor/gvisor.go | 7 ++++--- vm/starnix/starnix.go | 3 ++- vm/vm_test.go | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'vm') diff --git a/vm/gvisor/gvisor.go b/vm/gvisor/gvisor.go index 45c076b23..ed3018a51 100644 --- a/vm/gvisor/gvisor.go +++ b/vm/gvisor/gvisor.go @@ -21,11 +21,12 @@ import ( "github.com/google/syzkaller/pkg/log" "github.com/google/syzkaller/pkg/osutil" "github.com/google/syzkaller/pkg/report" + "github.com/google/syzkaller/sys/targets" "github.com/google/syzkaller/vm/vmimpl" ) func init() { - vmimpl.Register("gvisor", ctor, true) + vmimpl.Register(targets.GVisor, ctor, true) } type Config struct { @@ -146,8 +147,8 @@ func (pool *Pool) Create(workdir string, index int) (vmimpl.Instance, error) { tee = os.Stdout } merger := vmimpl.NewOutputMerger(tee) - merger.Add("gvisor", rpipe) - merger.Add("gvisor-goruntime", panicLogReadFD) + merger.Add("runsc", rpipe) + merger.Add("runsc-goruntime", panicLogReadFD) inst := &instance{ cfg: pool.cfg, diff --git a/vm/starnix/starnix.go b/vm/starnix/starnix.go index 51f2f670f..61c893305 100644 --- a/vm/starnix/starnix.go +++ b/vm/starnix/starnix.go @@ -17,12 +17,13 @@ import ( "github.com/google/syzkaller/pkg/log" "github.com/google/syzkaller/pkg/osutil" "github.com/google/syzkaller/pkg/report" + "github.com/google/syzkaller/sys/targets" "github.com/google/syzkaller/vm/vmimpl" ) func init() { var _ vmimpl.Infoer = (*instance)(nil) - vmimpl.Register("starnix", ctor, true) + vmimpl.Register(targets.Starnix, ctor, true) } type Config struct { diff --git a/vm/vm_test.go b/vm/vm_test.go index 4a6c91f41..4f0e2836d 100644 --- a/vm/vm_test.go +++ b/vm/vm_test.go @@ -431,7 +431,7 @@ func TestVMType(t *testing.T) { in string want string }{ - {"gvisor", "gvisor"}, + {targets.GVisor, targets.GVisor}, {"proxyapp:android", "proxyapp"}, } -- cgit mrf-deployment