Merge pull request #3028 from egernst/hypervisor-hacking

Hypervisor cleanup, refactoring
This commit is contained in:
Peng Tao
2021-11-26 10:21:49 +08:00
committed by GitHub
25 changed files with 201 additions and 161 deletions

View File

@@ -525,12 +525,9 @@ func newSandbox(ctx context.Context, sandboxConfig SandboxConfig, factory Factor
swapDevices: []*config.BlockDrive{},
}
hypervisor.setSandbox(s)
if s.store, err = persist.GetDriver(); err != nil || s.store == nil {
return nil, fmt.Errorf("failed to get fs persist driver: %v", err)
}
defer func() {
if retErr != nil {
s.Logger().WithError(retErr).Error("Create new sandbox failed")
@@ -538,6 +535,9 @@ func newSandbox(ctx context.Context, sandboxConfig SandboxConfig, factory Factor
}
}()
sandboxConfig.HypervisorConfig.VMStorePath = s.store.RunVMStoragePath()
sandboxConfig.HypervisorConfig.RunStorePath = s.store.RunStoragePath()
spec := s.GetPatchedOCISpec()
if spec != nil && spec.Process.SelinuxLabel != "" {
sandboxConfig.HypervisorConfig.SELinuxProcessLabel = spec.Process.SelinuxLabel