Blob Blame History Raw
From 9039b0fabc700982af9d86a1c0afcb951c6a90f7 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Wed, 25 Jul 2018 09:28:04 +0100
Subject: [PATCH 5/8] vddk: Improve error message if the proprietary library
 cannot be found.

(cherry picked from commit 94e791f87c6029983befa6199771345fd9cdfcc9)
---
 plugins/vddk/vddk.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/plugins/vddk/vddk.c b/plugins/vddk/vddk.c
index 4f03498..79bcf7f 100644
--- a/plugins/vddk/vddk.c
+++ b/plugins/vddk/vddk.c
@@ -142,12 +142,16 @@ error_function (const char *fs, va_list args)
 static void
 vddk_load (void)
 {
-  const char *soname = "libvixDiskLib.so.6";
+  static const char soname[] = "libvixDiskLib.so.6";
 
   /* Load the plugin and set the entry points. */
   dl = dlopen (soname, RTLD_NOW);
   if (dl == NULL) {
-    nbdkit_error ("%s: %s", soname, dlerror ());
+    nbdkit_error ("%s\n\n"
+                  "If '%s' is located on a non-standard path you may need to\n"
+                  "set $LD_LIBRARY_PATH or edit /etc/ld.so.conf.\n\n"
+                  "See the nbdkit-vddk-plugin(1) man page for details.",
+                  dlerror (), soname);
     exit (EXIT_FAILURE);
   }
 
-- 
2.18.0