]> git.ipfire.org Git - thirdparty/libvirt.git/commit
network: acquire a pidfile in the driver root directory
authorDaniel P. Berrangé <berrange@redhat.com>
Thu, 23 May 2019 10:34:08 +0000 (11:34 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 11 Jul 2019 11:46:20 +0000 (12:46 +0100)
commitc03aef7c87c9fbad72b45a695b93f7bb11819bc7
treeeaa29558f13138184980d368905ac5feef4d9406
parent8292b9e36417b5c02cb9b4d6438249edcbd22a6c
network: acquire a pidfile in the driver root directory

When we allow multiple instances of the driver for the same user
account, using a separate root directory, we need to ensure mutual
exclusion. Use a pidfile to guarantee this.

In privileged libvirtd this ends up locking

   /var/run/libvirt/network/driver.pid

In unprivileged libvirtd this ends up locking

  /run/user/$UID/libvirt/network/run/driver.pid

NB, the latter can vary depending on $XDG_RUNTIME_DIR

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/network/bridge_driver.c
src/network/bridge_driver_platform.h