diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2019-11-14 16:59:09 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2019-11-16 09:58:54 +0100 |
| commit | b5c36524a29838b0ec9345fc1a07daeebf50c833 (patch) | |
| tree | b25f237098577e50e3c1387454da625b50280478 /pkg/instance/instance.go | |
| parent | cdac920beb540736200639a6254e6dc01422e705 (diff) | |
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).
Diffstat (limited to 'pkg/instance/instance.go')
| -rw-r--r-- | pkg/instance/instance.go | 9 |
1 files changed, 4 insertions, 5 deletions
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"+ |
