diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2017-06-17 14:34:02 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2017-06-17 15:02:58 +0200 |
| commit | 97b58e7eae01ebe5df5d0bfdff4e6154e7ca869b (patch) | |
| tree | 83eb9d534ef9193e0ad8bf7aeb778c85b0ea602e /syz-manager | |
| parent | 260cdaa2b2dcdca9cc9d84c1bc08d00d451c68cd (diff) | |
syz-manager/mgrconfig: move sshkey from vm config to manager config
Sshkey is a property of image, which is in manager config.
Move sshkey to the same location as image.
The motivation for the move is as follows.
Continuous build produces an image and the key,
both need to be passed manager instance.
Continuous build system should not distinguish
different VM types and mess with their configs.
NOTE FOR USERS: this breaks manager configs again.
Hopefully the last time for now. Docs are updated.
Diffstat (limited to 'syz-manager')
| -rw-r--r-- | syz-manager/manager.go | 8 | ||||
| -rw-r--r-- | syz-manager/mgrconfig/mgrconfig.go | 13 | ||||
| -rw-r--r-- | syz-manager/mgrconfig/testdata/qemu.cfg | 4 |
3 files changed, 16 insertions, 9 deletions
diff --git a/syz-manager/manager.go b/syz-manager/manager.go index 465cf7aad..d577f5323 100644 --- a/syz-manager/manager.go +++ b/syz-manager/manager.go @@ -115,13 +115,7 @@ func main() { } func RunManager(cfg *mgrconfig.Config, syscalls map[int]bool) { - env := &vm.Env{ - Name: cfg.Name, - Workdir: cfg.Workdir, - Image: cfg.Image, - Debug: *flagDebug, - Config: cfg.VM, - } + env := mgrconfig.CreateVMEnv(cfg, *flagDebug) vmPool, err := vm.Create(cfg.Type, env) if err != nil { Fatalf("%v", err) diff --git a/syz-manager/mgrconfig/mgrconfig.go b/syz-manager/mgrconfig/mgrconfig.go index ace794d97..d6e2b4a2e 100644 --- a/syz-manager/mgrconfig/mgrconfig.go +++ b/syz-manager/mgrconfig/mgrconfig.go @@ -13,6 +13,7 @@ import ( "github.com/google/syzkaller/pkg/config" "github.com/google/syzkaller/pkg/osutil" "github.com/google/syzkaller/sys" + "github.com/google/syzkaller/vm" ) type Config struct { @@ -23,6 +24,7 @@ type Config struct { Vmlinux string Tag string // arbitrary optional tag that is saved along with crash reports (e.g. branch/commit) Image string // linux image for VMs + Sshkey string // root ssh key for the image (may be empty for some VM types) Hub_Addr string Hub_Key string @@ -214,3 +216,14 @@ func parseSuppressions(cfg *Config) error { } return nil } + +func CreateVMEnv(cfg *Config, debug bool) *vm.Env { + return &vm.Env{ + Name: cfg.Name, + Workdir: cfg.Workdir, + Image: cfg.Image, + Sshkey: cfg.Sshkey, + Debug: debug, + Config: cfg.VM, + } +} diff --git a/syz-manager/mgrconfig/testdata/qemu.cfg b/syz-manager/mgrconfig/testdata/qemu.cfg index 9a82f2d8e..62f9ccb1d 100644 --- a/syz-manager/mgrconfig/testdata/qemu.cfg +++ b/syz-manager/mgrconfig/testdata/qemu.cfg @@ -3,6 +3,7 @@ "workdir": "/syzkaller/workdir", "vmlinux": "/linux/vmlinux", "image": "/linux_image/wheezy.img", + "sshkey": "/linux_image/ssh/id_rsa", "syzkaller": "/syzkaller", "disable_syscalls": ["keyctl", "add_key", "request_key"], "suppressions": ["some known bug"], @@ -13,7 +14,6 @@ "cpu": 2, "mem": 2048, "kernel": "/linux/arch/x86/boot/bzImage", - "initrd": "linux/initrd", - "sshkey": "/linux_image/ssh/id_rsa" + "initrd": "linux/initrd" } } |
