]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Add some APIs which use locking for crashsafe pidfile handling
authorDaniel P. Berrange <berrange@redhat.com>
Wed, 6 Jul 2011 16:12:26 +0000 (17:12 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 12 Aug 2011 19:37:00 +0000 (20:37 +0100)
commite1da464d88cd39794809ec0d82dcdfbede744ad6
tree2d1f3925dd19d296f4d9db9acdd3dd3e9f2cb008
parentb7e5ca48f8c753a85ae77be3430fef83629d2178
Add some APIs which use locking for crashsafe pidfile handling

In daemons using pidfiles to protect against concurrent
execution there is a possibility that a crash may leave a stale
pidfile on disk, which then prevents later restart of the daemon.

To avoid this problem, introduce a pair of APIs which make
use of virFileLock to ensure crash-safe & race condition-safe
pidfile acquisition & releae

* src/libvirt_private.syms, src/util/virpidfile.c,
  src/util/virpidfile.h: Add virPidFileAcquire and virPidFileRelease
po/POTFILES.in
src/libvirt_private.syms
src/util/virpidfile.c
src/util/virpidfile.h