From b5c36524a29838b0ec9345fc1a07daeebf50c833 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 14 Nov 2019 16:59:09 +0100 Subject: sys/targets: add HostFuzzer flag Move HostFuzzer from vm/qemu. It's needed in a number of other packages and strictly saying is not specific to qemu (it just happened that both fuchsia and akaros only support qemu). --- pkg/instance/instance.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'pkg/instance') diff --git a/pkg/instance/instance.go b/pkg/instance/instance.go index ccb5265d1..775366667 100644 --- a/pkg/instance/instance.go +++ b/pkg/instance/instance.go @@ -24,6 +24,7 @@ import ( "github.com/google/syzkaller/pkg/report" "github.com/google/syzkaller/pkg/vcs" "github.com/google/syzkaller/prog" + "github.com/google/syzkaller/sys/targets" "github.com/google/syzkaller/vm" ) @@ -410,9 +411,8 @@ func (inst *inst) testProgram(command string, testTime time.Duration) error { func FuzzerCmd(fuzzer, executor, name, OS, arch, fwdAddr, sandbox string, procs, verbosity int, cover, debug, test, runtest bool) string { osArg := "" - switch OS { - case "akaros", "fuchsia": - // Only akaros needs OS, because the rest assume host OS. + if targets.Get(OS, arch).HostFuzzer { + // Only these OSes need the flag, because the rest assume host OS. // But speciying OS for all OSes breaks patch testing on syzbot // because old execprog does not have os flag. osArg = " -os=" + OS @@ -442,8 +442,7 @@ func ExecprogCmd(execprog, executor, OS, arch, sandbox string, repeat, threaded, repeatCount = 0 } osArg := "" - switch OS { - case "akaros", "fuchsia": + if targets.Get(OS, arch).HostFuzzer { osArg = " -os=" + OS } return fmt.Sprintf("%v -executor=%v -arch=%v%v -sandbox=%v"+ -- cgit mrf-deployment