mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
util: use host module suffix when loading drivers
Driver module loaders current hardcode ".so" as the file extension. On MacOS, meson uses ".dylib" as a module file extension. This patch adds VIR_FILE_MODULE_EXT to virfile.h defined as the hosts module extension, and updates driver module loaders to make use of it. Signed-off-by: Scott Shambarger <scott-libvirt@shambarger.net> Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
46d88d8dba
commit
89f5b90a5f
@ -55,7 +55,7 @@ virDriverLoadModule(const char *name,
|
||||
|
||||
if (!(modfile = virFileFindResourceFull(name,
|
||||
"libvirt_driver_",
|
||||
".so",
|
||||
VIR_FILE_MODULE_EXT,
|
||||
abs_top_builddir "/src",
|
||||
DEFAULT_DRIVER_DIR,
|
||||
"LIBVIRT_DRIVER_DIR")))
|
||||
|
@ -138,7 +138,7 @@ virLockManagerPluginPtr virLockManagerPluginNew(const char *name,
|
||||
} else {
|
||||
if (!(modfile = virFileFindResourceFull(name,
|
||||
NULL,
|
||||
".so",
|
||||
VIR_FILE_MODULE_EXT,
|
||||
abs_top_builddir "/src",
|
||||
LIBDIR "/libvirt/lock-driver",
|
||||
"LIBVIRT_LOCK_MANAGER_PLUGIN_DIR")))
|
||||
|
@ -91,7 +91,7 @@ virStorageDriverLoadBackendModule(const char *name,
|
||||
|
||||
if (!(modfile = virFileFindResourceFull(name,
|
||||
"libvirt_storage_backend_",
|
||||
".so",
|
||||
VIR_FILE_MODULE_EXT,
|
||||
abs_top_builddir "/src",
|
||||
STORAGE_BACKEND_MODULE_DIR,
|
||||
"LIBVIRT_STORAGE_BACKEND_DIR")))
|
||||
|
@ -36,6 +36,12 @@ typedef enum {
|
||||
VIR_FILE_CLOSE_DONT_LOG = 1 << 2,
|
||||
} virFileCloseFlags;
|
||||
|
||||
#ifdef __APPLE__
|
||||
# define VIR_FILE_MODULE_EXT ".dylib"
|
||||
#else
|
||||
# define VIR_FILE_MODULE_EXT ".so"
|
||||
#endif
|
||||
|
||||
ssize_t saferead(int fd, void *buf, size_t count) G_GNUC_WARN_UNUSED_RESULT;
|
||||
ssize_t safewrite(int fd, const void *buf, size_t count)
|
||||
G_GNUC_WARN_UNUSED_RESULT;
|
||||
|
@ -56,7 +56,7 @@ virStorageFileLoadBackendModule(const char *name,
|
||||
|
||||
if (!(modfile = virFileFindResourceFull(name,
|
||||
"libvirt_storage_file_",
|
||||
".so",
|
||||
VIR_FILE_MODULE_EXT,
|
||||
abs_top_builddir "/src",
|
||||
STORAGE_FILE_MODULE_DIR,
|
||||
"LIBVIRT_STORAGE_FILE_DIR")))
|
||||
|
Loading…
x
Reference in New Issue
Block a user