summaryrefslogtreecommitdiff
path: root/libpod/volume.go
diff options
context:
space:
mode:
authorflouthoc <flouthoc.git@gmail.com>2021-08-20 14:22:54 +0530
committerflouthoc <flouthoc.git@gmail.com>2021-08-23 20:42:41 +0530
commitedddfe8c4f7761b12dc64ea4aa0a83b755aa124f (patch)
tree4eb4323903b3aec46fd5da3dd7152c24d88045d0 /libpod/volume.go
parent30b036c5d394bb523fa13074b1731ad4b6259693 (diff)
downloadpodman-edddfe8c4f7761b12dc64ea4aa0a83b755aa124f.tar.gz
podman-edddfe8c4f7761b12dc64ea4aa0a83b755aa124f.tar.bz2
podman-edddfe8c4f7761b12dc64ea4aa0a83b755aa124f.zip
volumes: Add support for exporting volumes to external tar
Adds support for transferring data between systems and backing up systems. Use cases: recover from disasters or move data between machines. Signed-off-by: flouthoc <flouthoc.git@gmail.com>
Diffstat (limited to 'libpod/volume.go')
-rw-r--r--libpod/volume.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/libpod/volume.go b/libpod/volume.go
index 8f3dc4fcc..90b423f1d 100644
--- a/libpod/volume.go
+++ b/libpod/volume.go
@@ -139,6 +139,17 @@ func (v *Volume) MountPoint() (string, error) {
return v.mountPoint(), nil
}
+// MountCount returns the volume's mountcount on the host from state
+// Useful in determining if volume is using plugin or a filesystem mount and its mount
+func (v *Volume) MountCount() (uint, error) {
+ v.lock.Lock()
+ defer v.lock.Unlock()
+ if err := v.update(); err != nil {
+ return 0, err
+ }
+ return v.state.MountCount, nil
+}
+
// Internal-only helper for volume mountpoint
func (v *Volume) mountPoint() string {
if v.UsesVolumeDriver() {