summaryrefslogtreecommitdiff
path: root/libpod/boltdb_state_internal.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-08-27 13:45:11 -0400
committerMatthew Heon <matthew.heon@pm.me>2019-08-28 11:35:00 -0400
commite563f4111600a6c5506e4953bf796783a097544f (patch)
tree54cae975be3d0de2805d15d3305d74ef798ce799 /libpod/boltdb_state_internal.go
parentf221c6101934fccbd6705f3b387aadc9ae710f66 (diff)
downloadpodman-e563f4111600a6c5506e4953bf796783a097544f.tar.gz
podman-e563f4111600a6c5506e4953bf796783a097544f.tar.bz2
podman-e563f4111600a6c5506e4953bf796783a097544f.zip
Re-add locks to volumes.
This will require a 'podman system renumber' after being applied to get lock numbers for existing volumes. Add the DB backend code for rewriting volume configs and use it for updating lock numbers as part of 'system renumber'. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'libpod/boltdb_state_internal.go')
-rw-r--r--libpod/boltdb_state_internal.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/libpod/boltdb_state_internal.go b/libpod/boltdb_state_internal.go
index 408ef7224..6e4179835 100644
--- a/libpod/boltdb_state_internal.go
+++ b/libpod/boltdb_state_internal.go
@@ -449,6 +449,13 @@ func (s *BoltState) getVolumeFromDB(name []byte, volume *Volume, volBkt *bolt.Bu
return errors.Wrapf(err, "error unmarshalling volume %s config from DB", string(name))
}
+ // Get the lock
+ lock, err := s.runtime.lockManager.RetrieveLock(volume.config.LockID)
+ if err != nil {
+ return errors.Wrapf(err, "error retrieving lock for volume %q", string(name))
+ }
+ volume.lock = lock
+
volume.runtime = s.runtime
volume.valid = true