From 4ae17b1f4c91cfe2de0b2b51b67622dd0ac366af Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 11 Sep 2018 16:10:50 +0200 Subject: pkg/instance: support injected boot for vmm If pkg/build produces a kernel, inject it into vmm config too. This will allow continuous build with vmm VM type. Update #712 --- pkg/instance/instance.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'pkg/instance') diff --git a/pkg/instance/instance.go b/pkg/instance/instance.go index c7c457ea6..ffa8631a7 100644 --- a/pkg/instance/instance.go +++ b/pkg/instance/instance.go @@ -93,7 +93,7 @@ func SetConfigImage(cfg *mgrconfig.Config, imageDir string) error { if keyFile := filepath.Join(imageDir, "key"); osutil.IsExist(keyFile) { cfg.SSHKey = keyFile } - if cfg.Type == "qemu" { + if cfg.Type == "qemu" || cfg.Type == "vmm" { kernel := filepath.Join(imageDir, "kernel") if !osutil.IsExist(kernel) { kernel = "" @@ -103,19 +103,19 @@ func SetConfigImage(cfg *mgrconfig.Config, imageDir string) error { initrd = "" } if kernel != "" || initrd != "" { - qemu := make(map[string]interface{}) - if err := json.Unmarshal(cfg.VM, &qemu); err != nil { - return fmt.Errorf("failed to parse qemu config: %v", err) + vmConfig := make(map[string]interface{}) + if err := json.Unmarshal(cfg.VM, &vmConfig); err != nil { + return fmt.Errorf("failed to parse VM config: %v", err) } if kernel != "" { - qemu["kernel"] = kernel + vmConfig["kernel"] = kernel } if initrd != "" { - qemu["initrd"] = initrd + vmConfig["initrd"] = initrd } - vmCfg, err := json.Marshal(qemu) + vmCfg, err := json.Marshal(vmConfig) if err != nil { - return fmt.Errorf("failed to serialize qemu config: %v", err) + return fmt.Errorf("failed to serialize VM config: %v", err) } cfg.VM = vmCfg } -- cgit mrf-deployment