mirror of
https://github.com/ceph/ceph
synced 2025-01-19 17:41:39 +00:00
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 <sage@redhat.com>
This commit is contained in:
parent
8128045511
commit
42823a092c
@ -791,12 +791,18 @@ public:
|
||||
bool DaemonServer::handle_command(const ref_t<MCommand>& m)
|
||||
{
|
||||
std::lock_guard l(lock);
|
||||
auto cmdctx = std::make_shared<CommandContext>(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<CommandContext>(m);
|
||||
try {
|
||||
return _handle_command(cmdctx);
|
||||
} catch (const bad_cmd_get& e) {
|
||||
cmdctx->reply(-EINVAL, e.what());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user