]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-replay: improve error messages
authorJason Dillaman <dillaman@redhat.com>
Tue, 6 Oct 2015 17:16:51 +0000 (13:16 -0400)
committerJason Dillaman <dillaman@redhat.com>
Wed, 7 Oct 2015 19:41:23 +0000 (15:41 -0400)
Fixes: #13221
Backport: hammer
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/rbd_replay/Replayer.cc

index 1d1418c5ae83faded156c6e6c6b334b5059d5a98..53d60c5da1bfa0d9f18c8237f52f933308460b8f 100644 (file)
@@ -13,6 +13,7 @@
  */
 
 #include "Replayer.hpp"
+#include "common/errno.h"
 #include <boost/foreach.hpp>
 #include <boost/thread/thread.hpp>
 #include <fstream>
@@ -156,19 +157,20 @@ void Replayer::run(const std::string& replay_file) {
     rados.init(NULL);
     int r = rados.init_with_context(g_ceph_context);
     if (r) {
-      cerr << "Unable to read conf file: " << r << std::endl;
+      cerr << "Failed to initialize RADOS: " << cpp_strerror(r) << std::endl;
       goto out;
     }
     r = rados.connect();
     if (r) {
-      cerr << "Unable to connect to Rados: " << r << std::endl;
+      cerr << "Failed to connect to cluster: " << cpp_strerror(r) << std::endl;
       goto out;
     }
     m_ioctx = new librados::IoCtx();
     {
       r = rados.ioctx_create(m_pool_name.c_str(), *m_ioctx);
       if (r) {
-       cerr << "Unable to create IoCtx: " << r << std::endl;
+        cerr << "Failed to open pool " << m_pool_name << ": "
+             << cpp_strerror(r) << std::endl;
        goto out2;
       }
       m_rbd = new librbd::RBD();
@@ -176,7 +178,7 @@ void Replayer::run(const std::string& replay_file) {
 
       ifstream input(replay_file.c_str(), ios::in | ios::binary);
       if (!input.is_open()) {
-       cerr << "Unable to open " << replay_file << std::endl;
+       cerr << "Failed to open " << replay_file << std::endl;
        exit(1);
       }