Lines Matching refs:cmd
36 bool TransferManager::CommandsExecute(int fd, Command &cmd)
38 cmd.SetFileDescriptor(fd);
39 CommandFunction* cf = CommandFunctionFactory::GetInstance().GetCommandFunction(cmd.GetCommandHead());
41 LOG(ERROR) << "Failed to get cmd exec";
44 CommandResult ret = cf->Execute(cmd);
45 if (!CheckResult(ret, cmd.GetCommandLine(), cmd.GetCommandType())) {
51 static bool JudgeBlockVerifyCmdType(Command &cmd)
53 if (cmd.GetCommandType() == CommandType::NEW ||
54 cmd.GetCommandType() == CommandType::ERASE ||
55 cmd.GetCommandType() == CommandType::FREE ||
56 cmd.GetCommandType() == CommandType::ZERO) {
100 std::unique_ptr<Command> cmd = std::make_unique<Command>(transferParams_.get());
101 if (cmd == nullptr) {
105 if (!cmd->Init(*ct) || transferParams_->env == nullptr) {
112 if (cmd->GetCommandType() != CommandType::NEW) {
117 if (!transferParams_->canWrite && !JudgeBlockVerifyCmdType(*cmd)) {
120 if (!CommandsExecute(fd, *cmd)) {
121 LOG(ERROR) << "Running command : " << cmd->GetCommandLine() << " fail";
148 bool TransferManager::RegisterForRetry(const std::string &cmd)
156 bool ret = Utils::WriteStringToFile(fd, cmd);
174 std::string cmd = "";
175 if (!Utils::ReadFileToString(fd, cmd)) {
179 return cmd;
182 bool TransferManager::CheckResult(const CommandResult result, const std::string &cmd, const CommandType &type)
187 RegisterForRetry(cmd);