Changeset 31574 in vbox for trunk/src/VBox
- Timestamp:
- Aug 11, 2010 2:54:09 PM (14 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
r31539 r31574 433 433 ComPtr<IConsole> console; 434 434 CHECK_ERROR_BREAK(a->session, COMGETTER(Console)(console.asOutParam())); 435 CHECK_ERROR_BREAK(console, DiscardSavedState( ));435 CHECK_ERROR_BREAK(console, DiscardSavedState(true /* fDeleteFile */)); 436 436 } while (0); 437 437 CHECK_ERROR_BREAK(a->session, UnlockMachine()); -
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
r31568 r31574 1651 1651 if (machineState == MachineState_Saved) 1652 1652 { 1653 CHECK_ERROR(gConsole, DiscardSavedState( ));1653 CHECK_ERROR(gConsole, DiscardSavedState(true /* fDeleteFile */)); 1654 1654 } 1655 1655 /* -
trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSelectorWnd.cpp
r31500 r31574 770 770 771 771 CConsole console = session.GetConsole(); 772 console.DiscardSavedState( );772 console.DiscardSavedState(true /* fDeleteFile */); 773 773 if (!console.isOk()) 774 774 vboxProblem().cannotDiscardSavedState (console); -
trunk/src/VBox/Main/ConsoleImpl.cpp
r31543 r31574 2388 2388 } 2389 2389 2390 STDMETHODIMP Console::DiscardSavedState( )2390 STDMETHODIMP Console::DiscardSavedState(BOOL aRemoveFile) 2391 2391 { 2392 2392 AutoCaller autoCaller(this); … … 2400 2400 Global::stringifyMachineState(mMachineState)); 2401 2401 2402 HRESULT rc = S_OK; 2402 HRESULT rc = mControl->SetRemoveSavedStateFile(aRemoveFile); 2403 if (FAILED(rc)) return rc; 2403 2404 2404 2405 /* -
trunk/src/VBox/Main/MachineImpl.cpp
r31562 r31574 9659 9659 } 9660 9660 9661 /* default is to delete saved state on Saved -> PoweredOff transition */ 9662 mRemoveSavedState = true; 9663 9661 9664 /* Confirm a successful initialization when it's the case */ 9662 9665 autoInitSpan.setSucceeded(); … … 9952 9955 9953 9956 /** 9957 * @note Locks this object for writing. 9958 */ 9959 STDMETHODIMP SessionMachine::SetRemoveSavedStateFile(BOOL aRemove) 9960 { 9961 AutoCaller autoCaller(this); 9962 AssertComRCReturn(autoCaller.rc(), autoCaller.rc()); 9963 9964 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 9965 9966 mRemoveSavedState = aRemove; 9967 9968 return S_OK; 9969 } 9970 9971 /** 9954 9972 * @note Locks the same as #setMachineState() does. 9955 9973 */ … … 11262 11280 if (deleteSavedState) 11263 11281 { 11264 Assert(!mSSData->mStateFilePath.isEmpty()); 11265 RTFileDelete(mSSData->mStateFilePath.c_str()); 11282 if (mRemoveSavedState) 11283 { 11284 Assert(!mSSData->mStateFilePath.isEmpty()); 11285 RTFileDelete(mSSData->mStateFilePath.c_str()); 11286 } 11266 11287 mSSData->mStateFilePath.setNull(); 11267 11288 stsFlags |= SaveSTS_StateFilePath; -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r31572 r31574 2988 2988 wsmap="suppress" 2989 2989 > 2990 <method name="setRemoveSavedStateFile"> 2991 <desc> 2992 Updates the flag whether the saved state file is removed on a 2993 machine state change from Saved to PoweredOff. 2994 </desc> 2995 <param name="aRemove" type="boolean" dir="in"/> 2996 </method> 2997 2990 2998 <method name="updateState"> 2991 2999 <desc> 2992 3000 Updates the VM state. 2993 3001 <note> 2994 This operation will also update the settings file with 2995 the correct information about the saved state file2996 and delete this file from diskwhen appropriate.3002 This operation will also update the settings file with the correct 3003 information about the saved state file and delete this file from disk 3004 when appropriate. 2997 3005 </note> 2998 3006 </desc> … … 6151 6159 <desc> 6152 6160 Forcibly resets the machine to "Powered Off" state if it is 6153 currently in the "Saved" state (previously created by <link to="#saveState"/>) 6154 and deletes the file into which the machine state was saved. 6161 currently in the "Saved" state (previously created by <link to="#saveState"/>). 6155 6162 Next time the machine is powered up, a clean boot will occur. 6156 6163 <note> … … 6160 6167 computer, it can can lead to data loss. 6161 6168 </note> 6169 If @a fRemoveFile is @c true, the file in the machine directory 6170 into which the machine state was saved is also deleted. If 6171 this is @c false, then the state can be recovered and later 6172 re-inserted into a machine using <link to="#adoptSavedState" />. 6173 The location of the file can be found in the 6174 <link to="IMachine::stateFilePath" /> attribute. 6162 6175 <result name="VBOX_E_INVALID_VM_STATE"> 6163 6176 Virtual machine not in state Saved. 6164 6177 </result> 6165 6178 </desc> 6179 <param name="fRemoveFile" type="boolean" dir="in" > 6180 <desc>Whether to also remove the saved state file.</desc> 6181 </param> 6166 6182 </method> 6167 6183 -
trunk/src/VBox/Main/include/ConsoleImpl.h
r31539 r31574 138 138 STDMETHOD(SaveState)(IProgress **aProgress); 139 139 STDMETHOD(AdoptSavedState)(IN_BSTR aSavedStateFile); 140 STDMETHOD(DiscardSavedState)( );140 STDMETHOD(DiscardSavedState)(BOOL aRemoveFile); 141 141 STDMETHOD(GetDeviceActivity)(DeviceType_T aDeviceType, 142 142 DeviceActivity_T *aDeviceActivity); -
trunk/src/VBox/Main/include/MachineImpl.h
r31539 r31574 888 888 889 889 // IInternalMachineControl methods 890 STDMETHOD(SetRemoveSavedStateFile)(BOOL aRemove); 890 891 STDMETHOD(UpdateState)(MachineState_T machineState); 891 892 STDMETHOD(GetIPCId)(BSTR *id); … … 1025 1026 HRESULT updateMachineStateOnClient(); 1026 1027 1028 HRESULT mRemoveSavedState; 1029 1027 1030 SnapshotData mSnapshotData; 1028 1031
Note:
See TracChangeset
for help on using the changeset viewer.