]> git.ipfire.org Git - thirdparty/libvirt.git/commit
bhyve: 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)
commitdbfdbd9accc3002e4680b1e5dfde797005c6a2a2
treeb855bfe77c18d09d1f6e2ba7f4101b91bfb3c8c9
parent7cefe61172cedb1959d56a3c1525ea75f9cae6a0
bhyve: 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/bhyve/driver.pid

In unprivileged libvirtd this ends up locking

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

NB, the latter can vary depending on $XDG_RUNTIME_DIR

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/bhyve/bhyve_driver.c
src/bhyve/bhyve_utils.h