Merge pull request #505 from bergwolf/create_factory

cli: create vm factory if failed to load existing one
This commit is contained in:
Peng Tao
2018-07-24 10:43:41 +08:00
committed by GitHub

View File

@@ -120,8 +120,13 @@ func create(containerID, bundlePath, console, pidFilePath string, detach bool,
kataLog.WithField("factory", factoryConfig).Info("load vm factory")
f, err := vf.NewFactory(factoryConfig, true)
if err != nil {
kataLog.WithError(err).Info("load vm factory failed")
} else {
kataLog.WithError(err).Warn("load vm factory failed, about to create new one")
f, err = vf.NewFactory(factoryConfig, false)
if err != nil {
kataLog.WithError(err).Warn("create vm factory failed")
}
}
if err != nil {
vci.SetFactory(f)
}
}