From 42823a092c9568d07c1188930aa0828db359876b Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 6 Sep 2019 09:44:23 -0500 Subject: [PATCH] mgr/DaemonServer: route MCommand (for octopus+) to asok commands Send mgr 'tell' commands (if they originate from a octopus+ client that knows the difference between MCommand and MMgrCommand) to the asok comand queue. Signed-off-by: Sage Weil --- src/mgr/DaemonServer.cc | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/mgr/DaemonServer.cc b/src/mgr/DaemonServer.cc index d3b65dd2a2c5e..de894ad0b85f7 100644 --- a/src/mgr/DaemonServer.cc +++ b/src/mgr/DaemonServer.cc @@ -791,12 +791,18 @@ public: bool DaemonServer::handle_command(const ref_t& m) { std::lock_guard l(lock); - auto cmdctx = std::make_shared(m); - try { - return _handle_command(cmdctx); - } catch (const bad_cmd_get& e) { - cmdctx->reply(-EINVAL, e.what()); + if (HAVE_FEATURE(m->get_connection()->get_features(), SERVER_OCTOPUS)) { + cct->get_admin_socket()->queue_tell_command(m); return true; + } else { + // legacy client; send to CLI processing + auto cmdctx = std::make_shared(m); + try { + return _handle_command(cmdctx); + } catch (const bad_cmd_get& e) { + cmdctx->reply(-EINVAL, e.what()); + return true; + } } } -- 2.39.5