aboutsummaryrefslogtreecommitdiffstats
path: root/vm/odroid
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-06-17 14:34:02 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-06-17 15:02:58 +0200
commit97b58e7eae01ebe5df5d0bfdff4e6154e7ca869b (patch)
tree83eb9d534ef9193e0ad8bf7aeb778c85b0ea602e /vm/odroid
parent260cdaa2b2dcdca9cc9d84c1bc08d00d451c68cd (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 'vm/odroid')
-rw-r--r--vm/odroid/odroid.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/vm/odroid/odroid.go b/vm/odroid/odroid.go
index 69c77b9c6..2d1f0482e 100644
--- a/vm/odroid/odroid.go
+++ b/vm/odroid/odroid.go
@@ -39,7 +39,6 @@ type Config struct {
Hub_Bus int // host USB bus number for the USB hub
Hub_Device int // host USB device number for the USB hub
Hub_Port int // port on the USB hub to which Odroid is connected
- Sshkey string // root ssh key for the image
}
type Pool struct {
@@ -49,6 +48,7 @@ type Pool struct {
type instance struct {
cfg *Config
+ sshkey string
closed chan bool
debug bool
}
@@ -56,7 +56,7 @@ type instance struct {
func ctor(env *vmimpl.Env) (vmimpl.Pool, error) {
cfg := &Config{}
if err := config.LoadData(env.Config, cfg); err != nil {
- return nil, err
+ return nil, fmt.Errorf("failed to parse odroid vm config: %v", err)
}
if cfg.Host_Addr == "" {
return nil, fmt.Errorf("config param host_addr is empty")
@@ -76,8 +76,8 @@ func ctor(env *vmimpl.Env) (vmimpl.Pool, error) {
if cfg.Hub_Port == 0 {
return nil, fmt.Errorf("config param hub_port is empty")
}
- if !osutil.IsExist(cfg.Sshkey) {
- return nil, fmt.Errorf("ssh key '%v' does not exist", cfg.Sshkey)
+ if !osutil.IsExist(env.Sshkey) {
+ return nil, fmt.Errorf("ssh key '%v' does not exist", env.Sshkey)
}
if !osutil.IxExist(cfg.Console) {
return nil, fmt.Errorf("console file '%v' does not exist", cfg.Console)
@@ -96,6 +96,7 @@ func (pool *Pool) Count() int {
func (pool *Pool) Create(workdir string, index int) (vmimpl.Instance, error) {
inst := &instance{
cfg: pool.cfg,
+ sshkey: pool.env.Sshkey,
closed: make(chan bool),
debug: pool.env.Debug,
}
@@ -397,7 +398,7 @@ func (inst *instance) Run(timeout time.Duration, stop <-chan bool, command strin
func (inst *instance) sshArgs(portArg string) []string {
args := []string{
- "-i", inst.cfg.Sshkey,
+ "-i", inst.sshkey,
portArg, "22",
"-F", "/dev/null",
"-o", "ConnectionAttempts=10",