IsVMPending checks if a VM has a pending operation.
(vm *api.VM)
| 350 | |
| 351 | // IsVMPending checks if a VM has a pending operation. |
| 352 | func (s *State) IsVMPending(vm *api.VM) (bool, string) { |
| 353 | s.pendingMutex.RLock() |
| 354 | defer s.pendingMutex.RUnlock() |
| 355 | |
| 356 | key := fmt.Sprintf("%s:%d", vm.Node, vm.ID) |
| 357 | operation, exists := s.PendingVMOperations[key] |
| 358 | |
| 359 | return exists, operation |
| 360 | } |
| 361 | |
| 362 | // SetNodePending marks a node as having a pending operation. |
| 363 | func (s *State) SetNodePending(node *api.Node, operation string) { |
no outgoing calls
no test coverage detected