mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
daemon: Autodetect lock driver directory
When running libvirtd from a build directory, libvirtd would load lock drivers from system directory unless explicitly overridden by setting LIBVIRT_LOCK_MANAGER_PLUGIN_DIR environment variable. Since we already autodetect driver directory if libvirt is build with driver modules, we can use the same trick to automagically set lock driver directory.
This commit is contained in:
@@ -55,6 +55,7 @@
|
||||
#include "hooks.h"
|
||||
#include "uuid.h"
|
||||
#include "viraudit.h"
|
||||
#include "locking/lock_manager.h"
|
||||
|
||||
#ifdef WITH_DRIVER_MODULES
|
||||
# include "driver.h"
|
||||
@@ -971,7 +972,6 @@ int main(int argc, char **argv) {
|
||||
/* initialize early logging */
|
||||
virLogSetFromEnv();
|
||||
|
||||
#ifdef WITH_DRIVER_MODULES
|
||||
if (strstr(argv[0], "lt-libvirtd") ||
|
||||
strstr(argv[0], "/daemon/.libs/libvirtd")) {
|
||||
char *tmp = strrchr(argv[0], '/');
|
||||
@@ -990,11 +990,13 @@ int main(int argc, char **argv) {
|
||||
argv[0], driverdir);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
virLockManagerSetPluginDir(driverdir);
|
||||
#ifdef WITH_DRIVER_MODULES
|
||||
virDriverModuleInitialize(driverdir);
|
||||
#endif
|
||||
*tmp = '/';
|
||||
/* Must not free 'driverdir' - it is still used */
|
||||
}
|
||||
#endif
|
||||
|
||||
while (1) {
|
||||
int optidx = 0;
|
||||
|
||||
Reference in New Issue
Block a user