diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-11-29 10:40:36 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-11-30 13:33:18 +0100 |
| commit | 1fd901159188a5e0c2b3559ae7ec7deff7c4e7a2 (patch) | |
| tree | 82c9a88630b01824aab94866cbe1d405a7e7219d /pkg/instance/instance.go | |
| parent | a142e60d5cf11dc798e4909c97803d75add83a11 (diff) | |
pkg/mgrconfig: add prog&sys.targets targets to Config
These are widely used with the config as the refactoring shows.
This removes a bunch of unnecessary code.
Also fixes a number of bugs where we confused Arch with VMArch.
Diffstat (limited to 'pkg/instance/instance.go')
| -rw-r--r-- | pkg/instance/instance.go | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/pkg/instance/instance.go b/pkg/instance/instance.go index 467998a60..5ca1c2b78 100644 --- a/pkg/instance/instance.go +++ b/pkg/instance/instance.go @@ -22,7 +22,6 @@ import ( "github.com/google/syzkaller/pkg/osutil" "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" ) @@ -310,7 +309,7 @@ func (inst *inst) testInstance() error { // If SyzExecutorCmd is provided, it means that syz-executor is already in // the image, so no need to copy it. - executorCmd := targets.Get(inst.cfg.TargetOS, inst.cfg.TargetArch).SyzExecutorCmd + executorCmd := inst.cfg.SysTarget.SyzExecutorCmd if executorCmd == "" { executorCmd, err = inst.vm.Copy(inst.cfg.SyzExecutorBin) if err != nil { @@ -352,7 +351,7 @@ func (inst *inst) testRepro() error { } // If SyzExecutorCmd is provided, it means that syz-executor is already in // the image, so no need to copy it. - executorCmd := targets.Get(cfg.TargetOS, cfg.TargetArch).SyzExecutorCmd + executorCmd := cfg.SysTarget.SyzExecutorCmd if executorCmd == "" { executorCmd, err = inst.vm.Copy(inst.cfg.SyzExecutorBin) if err != nil { @@ -390,11 +389,7 @@ func (inst *inst) testRepro() error { if len(inst.reproC) == 0 { return nil } - target, err := prog.GetTarget(cfg.TargetOS, cfg.TargetArch) - if err != nil { - return err - } - bin, err := csource.BuildNoWarn(target, inst.reproC) + bin, err := csource.BuildNoWarn(cfg.Target, inst.reproC) if err != nil { return err } |
