]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: 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)
commit1af03e2714f19820f55952eeb98fe4f3c1233aec
tree259445e4d800782ca52ddce00b22d6f3096c5818
parent95f8e3237e5486f487324c64e881b1fa714b7a5c
qemu: 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/qemu/driver.pid

In unprivileged libvirtd this ends up locking

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

NB, the latter can vary depending on $XDG_RUNTIME_DIR

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/qemu/qemu_conf.h
src/qemu/qemu_driver.c