Changeset 42489 in vbox for trunk/src/VBox
- Timestamp:
- Jul 31, 2012 7:02:49 PM (13 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/MachineImpl.h
r42442 r42489 95 95 enum StateDependency 96 96 { 97 AnyStateDep = 0, MutableStateDep, MutableOrSavedStateDep 97 AnyStateDep = 0, 98 MutableStateDep, 99 MutableOrSavedStateDep, 100 OfflineStateDep 98 101 }; 99 102 -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r42442 r42489 1029 1029 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1030 1030 1031 HRESULT rc = checkStateDependency(MutableStateDep); 1031 // this can be done in principle in any state as it doesn't affect the VM 1032 // significantly, but play safe by not messing around while complex 1033 // activities are going on 1034 HRESULT rc = checkStateDependency(MutableOrSavedStateDep); 1032 1035 if (FAILED(rc)) return rc; 1033 1036 … … 1087 1090 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1088 1091 1089 rc = checkStateDependency(MutableStateDep); 1092 // changing machine groups is possible while the VM is offline 1093 rc = checkStateDependency(OfflineStateDep); 1090 1094 if (FAILED(rc)) return rc; 1091 1095 … … 4709 4713 /* when there was auto-conversion, we want to save the file even if 4710 4714 * the VM is saved */ 4711 HRESULT rc = checkStateDependency(Mutable StateDep);4715 HRESULT rc = checkStateDependency(MutableOrSavedStateDep); 4712 4716 if (FAILED(rc)) return rc; 4713 4717 … … 7657 7661 * properties when it is in the saved state. 7658 7662 * 7663 * When @a aDepType is OfflineStateDep, this method returns S_OK if the 7664 * state is one of the 4 offline states (PoweredOff, Saved, Teleported, 7665 * Aborted). 7666 * 7659 7667 * @param aDepType Dependency type to check. 7660 7668 * … … 7706 7714 return setError(VBOX_E_INVALID_VM_STATE, 7707 7715 tr("The machine is not mutable (state is %s)"), 7716 Global::stringifyMachineState(mData->mMachineState)); 7717 break; 7718 } 7719 case OfflineStateDep: 7720 { 7721 if ( mData->mRegistered 7722 && ( !isSessionMachine() 7723 || ( mData->mMachineState != MachineState_PoweredOff 7724 && mData->mMachineState != MachineState_Saved 7725 && mData->mMachineState != MachineState_Aborted 7726 && mData->mMachineState != MachineState_Teleported 7727 ) 7728 ) 7729 ) 7730 return setError(VBOX_E_INVALID_VM_STATE, 7731 tr("The machine is not offline (state is %s)"), 7708 7732 Global::stringifyMachineState(mData->mMachineState)); 7709 7733 break;
Note:
See TracChangeset
for help on using the changeset viewer.