summaryrefslogtreecommitdiff
path: root/libpod/runtime.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2017-11-27 13:42:45 -0500
committerMatthew Heon <matthew.heon@gmail.com>2017-12-04 13:40:27 -0500
commite9298a533adf30c3dd1990098665be23a0f29d1a (patch)
tree12b3d265a1c7d5435f2953bf91ee6f56d4f54d44 /libpod/runtime.go
parentabfd18b0db8cb0ea331d90d702eab19e2157b973 (diff)
downloadpodman-e9298a533adf30c3dd1990098665be23a0f29d1a.tar.gz
podman-e9298a533adf30c3dd1990098665be23a0f29d1a.tar.bz2
podman-e9298a533adf30c3dd1990098665be23a0f29d1a.zip
Remove SQL state locking and rely on sqlite locking
Also renames some parameters from locksDir -> lockDir for consistency. Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Diffstat (limited to 'libpod/runtime.go')
-rw-r--r--libpod/runtime.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go
index 616641fc1..ac7db51ca 100644
--- a/libpod/runtime.go
+++ b/libpod/runtime.go
@@ -25,7 +25,7 @@ type Runtime struct {
storageService *storageService
imageContext *types.SystemContext
ociRuntime *OCIRuntime
- locksDir string
+ lockDir string
valid bool
lock sync.RWMutex
}
@@ -138,15 +138,15 @@ func NewRuntime(options ...RuntimeOption) (runtime *Runtime, err error) {
}
// Make a directory to hold container lockfiles
- lockPath := filepath.Join(runtime.config.StaticDir, "lock")
- if err := os.MkdirAll(lockPath, 0755); err != nil {
+ lockDir := filepath.Join(runtime.config.StaticDir, "lock")
+ if err := os.MkdirAll(lockDir, 0755); err != nil {
// The directory is allowed to exist
if !os.IsExist(err) {
return nil, errors.Wrapf(err, "error creating runtime lockfiles directory %s",
- lockPath)
+ lockDir)
}
}
- runtime.locksDir = lockPath
+ runtime.lockDir = lockDir
// Make the per-boot files directory if it does not exist
if err := os.MkdirAll(runtime.config.TmpDir, 0755); err != nil {
@@ -166,7 +166,6 @@ func NewRuntime(options ...RuntimeOption) (runtime *Runtime, err error) {
runtime.state = state
} else {
dbPath := filepath.Join(runtime.config.StaticDir, "state.sql")
- lockPath := filepath.Join(runtime.config.TmpDir, "state.lck")
specsDir := filepath.Join(runtime.config.StaticDir, "ocispec")
// Make a directory to hold JSON versions of container OCI specs
@@ -178,7 +177,7 @@ func NewRuntime(options ...RuntimeOption) (runtime *Runtime, err error) {
}
}
- state, err := NewSQLState(dbPath, lockPath, specsDir, runtime.locksDir, runtime)
+ state, err := NewSQLState(dbPath, specsDir, runtime.lockDir, runtime)
if err != nil {
return nil, err
}