Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1056 from lifupan/fixVsock
Browse files Browse the repository at this point in the history
katautils: check config factory/template and vsock
  • Loading branch information
jodh-intel authored Dec 19, 2018
2 parents 07a0b16 + e4e7c3a commit 0d6a035
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/katautils/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -740,8 +740,14 @@ func checkNetNsConfig(config oci.RuntimeConfig) error {

// checkFactoryConfig ensures the VM factory configuration is valid.
func checkFactoryConfig(config oci.RuntimeConfig) error {
if config.FactoryConfig.Template && config.HypervisorConfig.InitrdPath == "" {
return errors.New("Factory option enable_template requires an initrd image")
if config.FactoryConfig.Template {
if config.HypervisorConfig.InitrdPath == "" {
return errors.New("Factory option enable_template requires an initrd image")
}

if config.HypervisorConfig.UseVSock {
return errors.New("config vsock conflicts with factory, please disable one of them")
}
}

return nil
Expand Down

0 comments on commit 0d6a035

Please sign in to comment.