Blame SOURCES/0005-vddk-Improve-error-message-if-the-proprietary-librar.patch

b61625
From a4e54de2e1ddbf7bd52e2b2e9857402ad93d5286 Mon Sep 17 00:00:00 2001
b61625
From: "Richard W.M. Jones" <rjones@redhat.com>
b61625
Date: Wed, 25 Jul 2018 09:28:04 +0100
b61625
Subject: [PATCH] vddk: Improve error message if the proprietary library cannot
b61625
 be found.
b61625
b61625
(cherry picked from commit 94e791f87c6029983befa6199771345fd9cdfcc9)
b61625
---
b61625
 plugins/vddk/vddk.c | 8 ++++++--
b61625
 1 file changed, 6 insertions(+), 2 deletions(-)
b61625
b61625
diff --git a/plugins/vddk/vddk.c b/plugins/vddk/vddk.c
b61625
index e8b1be5..67aaa61 100644
b61625
--- a/plugins/vddk/vddk.c
b61625
+++ b/plugins/vddk/vddk.c
b61625
@@ -142,12 +142,16 @@ error_function (const char *fs, va_list args)
b61625
 static void
b61625
 vddk_load (void)
b61625
 {
b61625
-  const char *soname = "libvixDiskLib.so.6";
b61625
+  static const char soname[] = "libvixDiskLib.so.6";
b61625
 
b61625
   /* Load the plugin and set the entry points. */
b61625
   dl = dlopen (soname, RTLD_NOW);
b61625
   if (dl == NULL) {
b61625
-    nbdkit_error ("%s: %s", soname, dlerror ());
b61625
+    nbdkit_error ("%s\n\n"
b61625
+                  "If '%s' is located on a non-standard path you may need to\n"
b61625
+                  "set $LD_LIBRARY_PATH or edit /etc/ld.so.conf.\n\n"
b61625
+                  "See the nbdkit-vddk-plugin(1) man page for details.",
b61625
+                  dlerror (), soname);
b61625
     exit (EXIT_FAILURE);
b61625
   }
b61625
 
b61625
-- 
b61625
1.8.3.1
b61625