From: Jason Dillaman Date: Tue, 6 Oct 2015 17:16:51 +0000 (-0400) Subject: rbd-replay: improve error messages X-Git-Tag: v0.94.6~69^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e7406fcba86646a4c3fbac66ee54b52ce3d5a33d;p=ceph.git rbd-replay: improve error messages Fixes: #13221 Backport: hammer Signed-off-by: Jason Dillaman (cherry picked from commit 4f436e10802d7b3c3949b592fec238c189a02c50) --- diff --git a/src/rbd_replay/Replayer.cc b/src/rbd_replay/Replayer.cc index 19403e51a3d6..9deb0ffb6e4a 100644 --- a/src/rbd_replay/Replayer.cc +++ b/src/rbd_replay/Replayer.cc @@ -13,6 +13,7 @@ */ #include "Replayer.hpp" +#include "common/errno.h" #include #include #include @@ -154,19 +155,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(); @@ -174,7 +176,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); }