summaryrefslogtreecommitdiff
path: root/libpod/state.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-08-30 16:09:17 -0400
committerMatthew Heon <matthew.heon@pm.me>2019-09-05 12:29:36 -0400
commit5a8a71ed817a4fa50fd9444846a50b76f25228d1 (patch)
treedee3a3bc42d410ff184acfa38d49ac1e5ad5bbed /libpod/state.go
parentc8193633cd82228b01e789becead410c2a940227 (diff)
downloadpodman-5a8a71ed817a4fa50fd9444846a50b76f25228d1.tar.gz
podman-5a8a71ed817a4fa50fd9444846a50b76f25228d1.tar.bz2
podman-5a8a71ed817a4fa50fd9444846a50b76f25228d1.zip
Add volume state
We need to be able to track the number of times a volume has been mounted for tmpfs/nfs/etc volumes. As such, we need a mutable state for volumes. Add one, with the expected update/save methods in both states. There is backwards compat here, in that older volumes without a state will still be accepted. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'libpod/state.go')
-rw-r--r--libpod/state.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/libpod/state.go b/libpod/state.go
index 5d704e69a..db4667ad6 100644
--- a/libpod/state.go
+++ b/libpod/state.go
@@ -203,6 +203,10 @@ type State interface {
// RemoveVolume removes the specified volume.
// Only volumes that have no container dependencies can be removed
RemoveVolume(volume *Volume) error
+ // UpdateVolume updates the volume's state from the database.
+ UpdateVolume(volume *Volume) error
+ // SaveVolume saves a volume's state to the database.
+ SaveVolume(volume *Volume) error
// AllVolumes returns all the volumes available in the state
AllVolumes() ([]*Volume, error)
}