Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/runtime/pkg/katautils/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1958,12 +1958,6 @@ func checkNetNsConfig(config oci.RuntimeConfig) error {

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

if config.FactoryConfig.VMCacheNumber > 0 {
if config.HypervisorType != vc.QemuHypervisor {
return errors.New("VM cache just support qemu")
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/pkg/katautils/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1626,7 +1626,7 @@ func TestCheckFactoryConfig(t *testing.T) {
{false, false, "", "initrd"},

{true, false, "", "initrd"},
{true, true, "image", ""},
{true, false, "image", ""},
}

for i, d := range data {
Expand Down
6 changes: 1 addition & 5 deletions src/runtime/pkg/katautils/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,8 @@ func HandleFactory(ctx context.Context, vci vc.VC, runtimeConfig *oci.RuntimeCon
kataUtilsLogger.WithField("factory", factoryConfig).Info("load vm factory")

f, err := vf.NewFactory(ctx, factoryConfig, true)
if err != nil && !factoryConfig.VMCache {
kataUtilsLogger.WithError(err).Warn("load vm factory failed, about to create new one")
f, err = vf.NewFactory(ctx, factoryConfig, false)
}
if err != nil {
kataUtilsLogger.WithError(err).Warn("create vm factory failed")
kataUtilsLogger.WithError(err).Warn("load vm factory failed, will use direct boot")
return
}

Expand Down
Loading
Loading