diff options
author | Matthew Heon <matthew.heon@gmail.com> | 2018-08-24 15:15:56 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2019-01-04 09:51:09 -0500 |
commit | d4b2f116018e1d8e6a3c4f80f30db45934428c6b (patch) | |
tree | 66b020a3db3824d4b5c9831a1b41043aa59a5150 /libpod/runtime_pod_linux.go | |
parent | 3de560053f4b391c8386554160f61a2a086c1564 (diff) | |
download | podman-d4b2f116018e1d8e6a3c4f80f30db45934428c6b.tar.gz podman-d4b2f116018e1d8e6a3c4f80f30db45934428c6b.tar.bz2 podman-d4b2f116018e1d8e6a3c4f80f30db45934428c6b.zip |
Convert pods to SHM locks
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Diffstat (limited to 'libpod/runtime_pod_linux.go')
-rw-r--r-- | libpod/runtime_pod_linux.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libpod/runtime_pod_linux.go b/libpod/runtime_pod_linux.go index 95246449a..529c516c8 100644 --- a/libpod/runtime_pod_linux.go +++ b/libpod/runtime_pod_linux.go @@ -48,6 +48,14 @@ func (r *Runtime) NewPod(ctx context.Context, options ...PodCreateOption) (*Pod, pod.config.Name = name } + // Allocate a lock for the pod + lock, err := r.lockManager.AllocateLock() + if err != nil { + return nil, errors.Wrapf(err, "error allocating lock for new pod") + } + pod.lock = lock + pod.config.LockID = pod.lock.ID() + pod.valid = true // Check CGroup parent sanity, and set it if it was not set |