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

Function execute

src/tools/rbd/action/MergeDiff.cc:419–448  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

417}
418
419int execute(const po::variables_map &vm,
420 const std::vector<std::string> &ceph_global_init_args) {
421 std::string first_diff = utils::get_positional_argument(vm, 0);
422 if (first_diff.empty()) {
423 std::cerr << "rbd: first diff was not specified" << std::endl;
424 return -EINVAL;
425 }
426
427 std::string second_diff = utils::get_positional_argument(vm, 1);
428 if (second_diff.empty()) {
429 std::cerr << "rbd: second diff was not specified" << std::endl;
430 return -EINVAL;
431 }
432
433 std::string path;
434 size_t arg_index = 2;
435 int r = utils::get_path(vm, &arg_index, &path);
436 if (r < 0) {
437 return r;
438 }
439
440 r = do_merge_diff(first_diff.c_str(), second_diff.c_str(), path.c_str(),
441 vm[at::NO_PROGRESS].as<bool>());
442 if (r < 0) {
443 std::cerr << "rbd: merge-diff error" << std::endl;
444 return -r;
445 }
446
447 return 0;
448}
449
450Shell::Action action(
451 {"merge-diff"}, {}, "Merge two diff exports together.", "",

Callers

nothing calls this directly

Calls 5

get_positional_argumentFunction · 0.85
do_merge_diffFunction · 0.85
get_pathFunction · 0.50
emptyMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected