}
int do_list(const std::string &pool_name, const std::string& namespace_name,
- bool lflag, int threads, Formatter *f) {
+ bool lflag, Formatter *f) {
std::vector<WorkerEntry*> workers;
std::vector<librbd::image_spec_t> images;
librados::Rados rados;
librbd::RBD rbd;
librados::IoCtx ioctx;
+ int r = utils::init(pool_name, namespace_name, &rados, &ioctx);
+ if (r < 0) {
+ return r;
+ }
+
+ int threads = g_conf().get_val<uint64_t>("rbd_concurrent_management_ops");
if (threads < 1) {
threads = 1;
}
threads = 32;
}
- int r = utils::init(pool_name, namespace_name, &rados, &ioctx);
- if (r < 0) {
- return r;
- }
-
utils::disable_cache();
r = rbd.list2(ioctx, &images);
}
r = do_list(pool_name, namespace_name, vm["long"].as<bool>(),
- g_conf().get_val<uint64_t>("rbd_concurrent_management_ops"),
formatter.get());
if (r < 0) {
std::cerr << "rbd: listing images failed: " << cpp_strerror(r)