MCPcopy Create free account
hub / github.com/ceph/ceph / start_command

Method start_command

src/mgr/MgrClient.cc:490–521  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

488}
489
490int MgrClient::start_command(vector<string>&& cmd, bufferlist&& inbl,
491 bufferlist *outbl, string *outs,
492 Context *onfinish)
493{
494 std::lock_guard l(lock);
495
496 ldout(cct, 20) << "cmd: " << cmd << dendl;
497
498 if (map.epoch == 0 && mgr_optional) {
499 ldout(cct,20) << " no MgrMap, assuming EACCES" << dendl;
500 return -EACCES;
501 }
502
503 auto &op = command_table.start_command();
504 op.cmd = std::move(cmd);
505 op.inbl = std::move(inbl);
506 op.outbl = outbl;
507 op.outs = outs;
508 op.on_finish = onfinish;
509
510 if (session && session->con) {
511 // Leaving fsid argument null because it isn't used historically, and
512 // we can use it as a signal that we are sending a non-tell command.
513 auto m = op.get_message(
514 {},
515 HAVE_FEATURE(map.active_mgr_features, SERVER_OCTOPUS));
516 session->con->send_message2(std::move(m));
517 } else {
518 ldout(cct, 5) << "no mgr session (no running mgr daemon?), waiting" << dendl;
519 }
520 return 0;
521}
522
523int MgrClient::start_tell_command(
524 string&& name,

Callers 4

mds_commandMethod · 0.80
start_tell_commandMethod · 0.80
mgr_commandMethod · 0.80
handle_commandMethod · 0.80

Calls 2

get_messageMethod · 0.80
send_message2Method · 0.80

Tested by

no test coverage detected