Displaying 6 results from an estimated 6 matches for "nbdkit_set_dlopen_prefix".
2020 Feb 16
0
[nbdkit PATCH v4 1/4] server: Export nbdkit_set_dlopen_prefix function
...create mode 100644 server/shim.c
diff --git a/docs/nbdkit-plugin.pod b/docs/nbdkit-plugin.pod
index 41bffb7f..f3825067 100644
--- a/docs/nbdkit-plugin.pod
+++ b/docs/nbdkit-plugin.pod
@@ -1207,6 +1207,20 @@ and returns C<NULL>.
The returned string must be freed by the caller.
+=head2 C<nbdkit_set_dlopen_prefix>
+
+ int nbdkit_set_dlopen_prefix (const char *prefix);
+
+Some plugins load a shared library that in turn uses L<dlopen(3)> to
+load further libraries. If these libraries reside in non-standard
+locations, it may be necessary to prefix any bare library names with
+the desired directory t...
2020 Feb 16
0
[nbdkit PATCH v4 2/4] tests: Add coverage of new nbdkit_set_dlopen_prefix
...BDKIT_THREAD_MODEL_PARALLEL
+
+static const char *libdir;
+
+static int
+dlopen_config (const char *key, const char *value)
+{
+ if (strcmp (key, "libdir") == 0)
+ libdir = value;
+ return 0;
+}
+
+static int
+dlopen_config_complete (void)
+{
+ char *msg;
+
+ if (libdir) {
+ if (nbdkit_set_dlopen_prefix (libdir) == -1)
+ return -1;
+ }
+
+ /* The main goal of this plugin is to show that we can hook dlopen.
+ * Test this by requesting a library that doesn't exist, where the
+ * difference in the error message shows if we were successful.
+ */
+ dlopen ("no_one_has_a_library_b...
2020 Feb 17
5
[nbdkit PATCH v5 0/4] vddk: Drive library loading from libdir parameter.
...t we export. With that done, there is no
separate shared library needed; our dlopen shim is now part of nbdkit
proper, and we don't have to tweak the wrapper script or install a
separate file.
Patches 2 and 4 had minor rebase churn, patch 3 remains untouched.
Eric Blake (2):
server: Export nbdkit_set_dlopen_prefix function
tests: Add coverage of new nbdkit_set_dlopen_prefix
Richard W.M. Jones (2):
vddk: Delay loading VDDK until config_complete.
vddk: Drive library loading from libdir parameter.
docs/nbdkit-plugin.pod | 14 +++
include/nbdkit-common.h | 2 +
plugins/vddk/n...
2020 Feb 16
6
[nbdkit PATCH v4 0/4] vddk: Drive library loading from libdir parameter.
...arated the testing of our dlopen shim into a separate
test in patch 2, rather than cramming into test-vddk.sh).
As before, I don't have the actual proprietary VDDK library installed,
so I'm still waiting on Rich's verdict that test-vddk-real.sh passes.
Eric Blake (2):
server: Export nbdkit_set_dlopen_prefix function
tests: Add coverage of new nbdkit_set_dlopen_prefix
Richard W.M. Jones (2):
vddk: Delay loading VDDK until config_complete.
vddk: Drive library loading from libdir parameter.
docs/nbdkit-plugin.pod | 14 +++
include/nbdkit-common.h | 2 +
plugins/vddk/n...
2020 Feb 13
1
[nbdkit PATCH v3] vddk: Drive library loading from libdir parameter.
...e <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+static void *(*orig_dlopen) (const char *filename, int flags);
+
+/* NULL for normal behavior, or set when we want to override
+ * relative dlopen()s to instead be an absolute open with prefix.
+ */
+static char *dir;
+
+int nbdkit_set_dlopen_prefix (const char *newdir)
+{
+ free (dir);
+ if (newdir) {
+ dir = strdup (newdir);
+ if (!dir)
+ return -1;
+ }
+ else
+ dir = NULL;
+ return 0;
+}
+
+void *dlopen(const char *filename, int flags)
+{
+ char *tmp = NULL;
+ void *ret;
+
+ if (dir && ! strchr (filename, '...
2020 Feb 17
0
[nbdkit PATCH v5 4/4] vddk: Drive library loading from libdir parameter.
...t using libdir and
expecting LD_LIBRARY_PATH to work, so it's a change in behaviour which
we will have to highlight prominently in the 1.18 release notes.
Thanks: Dan Berrangé, Ming Xie, Eric Blake.
[eblake: Several modifications to Rich's initial patch, mainly to take
advantage of the new nbdkit_set_dlopen_prefix]
---
plugins/vddk/nbdkit-vddk-plugin.pod | 39 +++++++++++++++++++------
plugins/vddk/vddk.c | 44 +++++++++++++++++++++++++----
tests/test-vddk-real.sh | 10 +------
tests/test-vddk.sh | 6 +---
4 files changed, 71 insertions(+), 28 deletions(-)
diff...