From: Jason Dillaman Date: Tue, 4 Aug 2020 18:39:36 +0000 (-0400) Subject: rbd: 'list' action should connect to cluster before querying config X-Git-Tag: wip-pdonnell-testing-20200918.022351~291^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=1527dcfa6d57a1644fa569a3270cb72f058fae44;p=ceph-ci.git rbd: 'list' action should connect to cluster before querying config This will allow global config overrides for the max concurrent ops to be applied prior to listing the images. Signed-off-by: Jason Dillaman --- diff --git a/src/tools/rbd/action/List.cc b/src/tools/rbd/action/List.cc index b42695b31b3..b63f97aeb23 100644 --- a/src/tools/rbd/action/List.cc +++ b/src/tools/rbd/action/List.cc @@ -169,13 +169,19 @@ int list_process_image(librados::Rados* rados, WorkerEntry* w, bool lflag, Forma } 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 workers; std::vector 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("rbd_concurrent_management_ops"); if (threads < 1) { threads = 1; } @@ -183,11 +189,6 @@ int do_list(const std::string &pool_name, const std::string& namespace_name, 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); @@ -326,7 +327,6 @@ int execute(const po::variables_map &vm, } r = do_list(pool_name, namespace_name, vm["long"].as(), - g_conf().get_val("rbd_concurrent_management_ops"), formatter.get()); if (r < 0) { std::cerr << "rbd: listing images failed: " << cpp_strerror(r)