mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
Use virFileFindResource to locate virtlockd daemon
Make the lock plugin use virFileFindResource to find the virtlockd daemon path, so that it executes the in-builddir daemon if run from source tree. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
57e5c3c2ae
commit
e18a80a3a0
2
run.in
2
run.in
@ -55,7 +55,7 @@ export LD_LIBRARY_PATH
|
||||
|
||||
export LIBVIRT_DRIVER_DIR="$b/src/.libs"
|
||||
export LIBVIRT_LOCK_MANAGER_PLUGIN_DIR="$b/src/.libs"
|
||||
export VIRTLOCKD_PATH="$b/src/virtlockd"
|
||||
export VIRTLOCKD_PATH="$b/src"
|
||||
export LIBVIRTD_PATH="$b/daemon"
|
||||
|
||||
# This is a cheap way to find some use-after-free and uninitialized
|
||||
|
@ -81,22 +81,6 @@ struct _virLockManagerLockDaemonDriver {
|
||||
|
||||
static virLockManagerLockDaemonDriverPtr driver = NULL;
|
||||
|
||||
#define VIRTLOCKD_PATH SBINDIR "/virtlockd"
|
||||
|
||||
static const char *
|
||||
virLockManagerLockDaemonFindDaemon(void)
|
||||
{
|
||||
const char *customDaemon = virGetEnvBlockSUID("VIRTLOCKD_PATH");
|
||||
|
||||
if (customDaemon)
|
||||
return customDaemon;
|
||||
|
||||
if (virFileIsExecutable(VIRTLOCKD_PATH))
|
||||
return VIRTLOCKD_PATH;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int virLockManagerLockDaemonLoadConfig(const char *configFile)
|
||||
{
|
||||
virConfPtr conf;
|
||||
@ -266,8 +250,13 @@ static virNetClientPtr virLockManagerLockDaemonConnectionNew(bool privileged,
|
||||
if (!(lockdpath = virLockManagerLockDaemonPath(privileged)))
|
||||
goto error;
|
||||
|
||||
if (!privileged)
|
||||
daemonPath = virLockManagerLockDaemonFindDaemon();
|
||||
if (!privileged &&
|
||||
!(daemonPath = virFileFindResourceFull("virtlockd",
|
||||
NULL, NULL,
|
||||
"src",
|
||||
SBINDIR,
|
||||
"VIRTLOCKD_PATH")))
|
||||
goto error;
|
||||
|
||||
if (!(client = virNetClientNewUNIX(lockdpath,
|
||||
daemonPath != NULL,
|
||||
|
Loading…
Reference in New Issue
Block a user