Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit d9023bd

Browse files
authored
Merge pull request #505 from Crazykev/vm-root
Add symbol link vm root in container root dir
2 parents ac7c55a + 422a26c commit d9023bd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

supervisor/container.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,13 @@ func (c *Container) create() error {
157157
return err
158158
}
159159

160+
// Create vm root dir symbol link in container root dir
161+
vmRootLinkPath := filepath.Join(stateDir, "vm-root")
162+
vmRootPath := filepath.Join(hypervisor.BaseDir, c.ownerPod.vm.Id)
163+
if err := os.Symlink(vmRootPath, vmRootLinkPath); err != nil {
164+
return fmt.Errorf("failed to create symbol link %q: %v", vmRootLinkPath, err)
165+
}
166+
160167
err = execPrestartHooks(c.Spec, state)
161168
if err != nil {
162169
glog.V(1).Infof("execute Prestart hooks failed, %s\n", err.Error())

0 commit comments

Comments
 (0)