]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-wnbd: improve image map error message 52289/head
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Mon, 22 May 2023 10:01:19 +0000 (10:01 +0000)
committerIlya Dryomov <idryomov@gmail.com>
Sun, 2 Jul 2023 13:24:13 +0000 (15:24 +0200)
"rbd-wnbd map" commands are delegated to the centralized
ceph-rbd Windows service, which in turn will create the
actual image mapping. This allows the daemons to continue
running even after the current session ends.

rbd-wnbd communicates with the service through a named pipe.
If the operation fails, we're only getting an error code.

This change will print the according error message based on the
error code, suggesting the user to check the logs or use
foreground mode ("-f") for additional information.

We could also capture the entire subprocess console output and
print it in case of errors. This can be quite verbose, so we'll
keep it simple for now.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
(cherry picked from commit 5bbcfc82970bd3a76536a7dd554096bec70ddc2d)

src/tools/rbd_wnbd/rbd_wnbd.cc

index 0c5dc9990869105bf96ef63b7e3af8378b3b3005..fab1e55c5206912ffe6018eaecca0adca2e00548 100644 (file)
@@ -299,8 +299,11 @@ int send_map_request(std::string arguments) {
     return -EINVAL;
   }
   if (reply.status) {
-    derr << "The ceph service failed to map the image. Error: "
-         << reply.status << dendl;
+    derr << "The ceph service failed to map the image. "
+         << "Check the log file or pass '-f' (foreground mode) "
+         << "for additional information. "
+         << "Error: " << cpp_strerror(reply.status)
+         << dendl;
   }
 
   return reply.status;