summaryrefslogtreecommitdiff
path: root/libpod/lock/shm
Commit message (Collapse)AuthorAge
* Delete prior /dev/shm/*Lokesh Mandvekar2020-08-28
| | | | | | | | | | Currently, subsequent runs of `make localunit` fail and complain about prior existing /dev/shm/libpod_test and /dev/shm/test1. This commit deletes these files if existing already, prior to running the tests. Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
* shm_lock_test: add nil checkValentin Rothberg2020-05-11
| | | | | Fixes: #6164 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* Make libpod/lock/shm completely Linux-onlyMiloslav Trmač2020-03-21
| | | | | | | If the tests are not Linux-only, (go test ./...) still tries to build and test the package. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
* codespell: spelling correctionsDmitry Smirnov2019-11-13
| | | | Signed-off-by: Dmitry Smirnov <onlyjob@member.fsf.org>
* trivial cleanups from golangbaude2019-07-03
| | | | | | the results of a code cleanup performed by the goland IDE. Signed-off-by: baude <bbaude@redhat.com>
* lock: disable without cgoGiuseppe Scrivano2019-07-02
| | | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* Build cgo files with -Wall -WerrorSascha Grunert2019-06-21
| | | | | | | | To avoid unnecessary warnings and errors in the future I'd like to propose building all cgo related sources with `-Wall -Werror`. This commit fixes some warnings which came up in `shm_lock.c`, too. Signed-off-by: Sascha Grunert <sgrunert@suse.com>
* When refreshing after a reboot, force lock allocationMatthew Heon2019-05-06
| | | | | | | | | | | | | | After a reboot, when we refresh Podman's state, we retrieved the lock from the fresh SHM instance, but we did not mark it as allocated to prevent it being handed out to other containers and pods. Provide a method for marking locks as in-use, and use it when we refresh Podman state after a reboot. Fixes #2900 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* Recreate SHM locks when renumbering on count mismatchMatthew Heon2019-02-21
| | | | | | | | | | | | | | When we're renumbering locks, we're destroying all existing allocations anyways, so destroying the old lock struct is not a particularly big deal. Existing long-lived libpod instances will continue to use the old locks, but that will be solved in a followon. Also, solve an issue with returning error values in the C code. There were a few places where we return ERRNO where it was not set, so make them return actual error codes). Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* Add initial version of renumber backendMatthew Heon2019-02-21
| | | | | | | | | Renumber is a way of renumbering container locks after the number of locks available has changed. For now, renumber only works with containers. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* Address lingering review comments from SHM locking PRMatthew Heon2019-01-07
| | | | Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* Rootless with shmlocks was not working.Daniel J Walsh2019-01-05
| | | | | | | | This patch makes the path unigue to each UID. Also cleans up some return code to return the path it is trying to lock. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Update unit tests to use in-memory lock managerMatthew Heon2019-01-04
| | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
* Convert pods to SHM locksMatthew Heon2019-01-04
| | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
* Add lock manager to libpod runtimeMatthew Heon2019-01-04
| | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
* Move to POSIX mutexes for SHM locksMatthew Heon2019-01-04
| | | | Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
* Disable lint on SHMLock structMatthew Heon2019-01-04
| | | | | | | | Golint wants to rename the struct. I think the name is fine. I can disable golint. Golint will no longer complain about the name. Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
* Refactor locks package to build on non-LinuxMatthew Heon2019-01-04
Move SHM specific code into a subpackage. Within the main locks package, move the manager to be linux-only and add a non-Linux unsupported build file. Signed-off-by: Matthew Heon <matthew.heon@gmail.com>