void VMGahp::executeCommand(VMRequest *req) { char *command = req->m_args.argv[0]; priv_state priv = set_user_priv(); if(strcasecmp(command, VMGAHP_COMMAND_VM_START) == 0 ) { executeStart(req); } else if(strcasecmp(command, VMGAHP_COMMAND_VM_STOP) == 0 ) { executeStop(req); } else if(strcasecmp(command, VMGAHP_COMMAND_VM_SUSPEND) == 0 ) { executeSuspend(req); } else if(strcasecmp(command, VMGAHP_COMMAND_VM_SOFT_SUSPEND) == 0 ) { executeSoftSuspend(req); } else if(strcasecmp(command, VMGAHP_COMMAND_VM_RESUME) == 0 ) { executeResume(req); } else if(strcasecmp(command, VMGAHP_COMMAND_VM_CHECKPOINT) == 0 ) { executeCheckpoint(req); } else if(strcasecmp(command, VMGAHP_COMMAND_VM_STATUS) == 0 ) { executeStatus(req); } else if(strcasecmp(command, VMGAHP_COMMAND_VM_GETPID) == 0 ) { executeGetpid(req); } else { vmprintf(D_ALWAYS, "Unknown command(%s)\n", command); } set_priv(priv); }
TreeNodeStatus ITimedNode::execute(const AIPtr& entity, long deltaMillis) { const TreeNodeStatus result = TreeNode::execute(entity, deltaMillis); if (result == CANNOTEXECUTE) return CANNOTEXECUTE; if (_timerMillis == NOTSTARTED) { _timerMillis = _millis; const TreeNodeStatus status = executeStart(entity, deltaMillis); if (status == FINISHED) _timerMillis = NOTSTARTED; return state(entity, status); } if (_timerMillis - deltaMillis > 0) { _timerMillis -= deltaMillis; const TreeNodeStatus status = executeRunning(entity, deltaMillis); if (status == FINISHED) _timerMillis = NOTSTARTED; return state(entity, status); } _timerMillis = NOTSTARTED; return state(entity, executeExpired(entity, deltaMillis)); }