diff options
author | Matthew Heon <matthew.heon@pm.me> | 2019-08-27 13:45:11 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2019-08-28 11:35:00 -0400 |
commit | e563f4111600a6c5506e4953bf796783a097544f (patch) | |
tree | 54cae975be3d0de2805d15d3305d74ef798ce799 /libpod/boltdb_state_internal.go | |
parent | f221c6101934fccbd6705f3b387aadc9ae710f66 (diff) | |
download | podman-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.go | 7 |
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 |