Blame SOURCES/kvm-block-vxhs-improve-error-message-for-missing-bad-vxh.patch

9bac43
From 23c1a34ecd6ca7f986ffff7a04deeb3eab0948c9 Mon Sep 17 00:00:00 2001
9bac43
From: Jeffrey Cody <jcody@redhat.com>
9bac43
Date: Mon, 11 Dec 2017 22:38:12 +0100
9bac43
Subject: [PATCH 2/6] block/vxhs: improve error message for missing / bad vxhs
9bac43
 module
9bac43
9bac43
RH-Author: Jeffrey Cody <jcody@redhat.com>
9bac43
Message-id: <59af10d83125fff42beacd30dbca83d50409bbed.1513031708.git.jcody@redhat.com>
9bac43
Patchwork-id: 78305
9bac43
O-Subject: [RHV7.5 qemu-kvm-rhev PATCH 1/1] block/vxhs: improve error message for missing / bad vxhs module
9bac43
Bugzilla: 1505654
9bac43
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
9bac43
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
9bac43
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
9bac43
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
9bac43
9bac43
[Downstream only, as the module load of libvxhs is downstream only]
9bac43
9bac43
In the case of missing libvxhs libraries, the original error message,
9bac43
while technically accurate, may lead a user to think there is a QEMU bug
9bac43
if trying to using the VXHS protocol.  Update the message so that it is
9bac43
clear that the likely issue is that the Veritas QEMU libvxhs RPM is not
9bac43
installed (or not installed correctly, if there are permission or file
9bac43
corruption issues, etc.).
9bac43
9bac43
An example error message before this change:
9bac43
9bac43
> qemu-img info vxhs://localhost/test
9bac43
qemu-img: Could not open 'vxhs://localhost/test': \
9bac43
        error loading libvxhs: /usr/lib64/qemu/libvxhs.so.1: \
9bac43
        cannot open shared object file: No such file or directory
9bac43
9bac43
An example error message after this change:
9bac43
9bac43
> qemu-img info vxhs://localhost/test
9bac43
qemu-img: Could not open 'vxhs://localhost/test': \
9bac43
        The VXHS library from Veritas might not be installed correctly \
9bac43
        (/usr/lib64/qemu/libvxhs.so.1: \
9bac43
         cannot open shared object file: No such file or directory)
9bac43
9bac43
Signed-off-by: Jeff Cody <jcody@redhat.com>
9bac43
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9bac43
---
9bac43
 block/vxhs.c | 3 ++-
9bac43
 1 file changed, 2 insertions(+), 1 deletion(-)
9bac43
9bac43
diff --git a/block/vxhs.c b/block/vxhs.c
9bac43
index a18154c..68edb51 100644
9bac43
--- a/block/vxhs.c
9bac43
+++ b/block/vxhs.c
9bac43
@@ -115,7 +115,8 @@ static void bdrv_vxhs_load_libs(Error **errp)
9bac43
     libvxhs_handle = g_module_open(LIBVXHS_FULL_PATHNAME,
9bac43
                                    G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
9bac43
     if (!libvxhs_handle) {
9bac43
-        error_setg(errp, "error loading libvxhs: %s", g_module_error());
9bac43
+        error_setg(errp, "The VXHS library from Veritas might not be installed "
9bac43
+                   "correctly (%s)", g_module_error());
9bac43
         return;
9bac43
     }
9bac43
 
9bac43
-- 
9bac43
1.8.3.1
9bac43