Which can fail.
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
// specialized command that will only exist in the Jewel series,
// and doesn't require the initialization of the `driver` member
// that is done below.
- rados.connect();
+ r = rados.connect();
+ if (r < 0) {
+ std::cerr << "couldn't connect to cluster: " << cpp_strerror(r)
+ << std::endl;
+ return r;
+ }
// Initialize metadata_io from pool on command line
if (metadata_pool_name.empty()) {
}
dout(4) << "connecting to RADOS..." << dendl;
- rados.connect();
+ r = rados.connect();
+ if (r < 0) {
+ std::cerr << "couldn't connect to cluster: " << cpp_strerror(r)
+ << std::endl;
+ return r;
+ }
+
r = driver->init(rados, fsmap, fscid);
if (r < 0) {
return r;
}
dout(4) << "connecting to RADOS..." << dendl;
- rados.connect();
-
-
+ r = rados.connect();
+ if (r < 0) {
+ derr << "couldn't connect to cluster: " << cpp_strerror(r) << dendl;
+ return r;
+ }
// Require at least 3 args <rank> <mode> <arg> [args...]
if (argv.size() < 3) {