Changeset 37851 in vbox for trunk/src/VBox/Main
- Timestamp:
- Jul 8, 2011 5:04:03 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 72745
- Location:
- trunk/src/VBox/Main
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r37831 r37851 2933 2933 <interface 2934 2934 name="IInternalMachineControl" extends="$unknown" 2935 uuid=" 31de448d-ef5e-4f79-9206-a8e830cbf9ea"2935 uuid="2087906d-bb92-43a0-8014-4cab009e4888" 2936 2936 internal="yes" 2937 2937 wsmap="suppress" … … 3224 3224 <method name="deleteSnapshot"> 3225 3225 <desc> 3226 Gets called by <link to="IConsole::deleteSnapshot"/> and 3227 <link to="IConsole::deleteSnapshotAndAllChildren"/>. 3226 Gets called by <link to="IConsole::deleteSnapshot"/>, 3227 <link to="IConsole::deleteSnapshotAndAllChildren"/> and 3228 <link to="IConsole::deleteSnapshotRange"/>. 3228 3229 <result name="VBOX_E_INVALID_OBJECT_STATE"> 3229 3230 Snapshot has more than one child snapshot. Only possible if the 3230 delete operation does not delete all children. 3231 delete operation does not delete all children or the range does 3232 not meet the linearity condition. 3231 3233 </result> 3232 3234 </desc> … … 3234 3236 <desc>The console object that initiated this call.</desc> 3235 3237 </param> 3236 <param name="id" type="uuid" mod="string" dir="in"> 3237 <desc>UUID of the snapshot to delete.</desc> 3238 <param name="startId" type="uuid" mod="string" dir="in"> 3239 <desc>UUID of the first snapshot to delete.</desc> 3240 </param> 3241 <param name="endId" type="uuid" mod="string" dir="in"> 3242 <desc>UUID of the last snapshot to delete.</desc> 3238 3243 </param> 3239 3244 <param name="deleteAllChildren" type="boolean" dir="in"> … … 6244 6249 <interface 6245 6250 name="IConsole" extends="$unknown" 6246 uuid=" 7fcaa74a-5d69-4c83-a357-404a60664e47"6251 uuid="1968b7d3-e3bf-4ceb-99e0-cb7c913317bb" 6247 6252 wsmap="managed" 6248 6253 > … … 6937 6942 <param name="id" type="uuid" mod="string" dir="in"> 6938 6943 <desc>UUID of the snapshot to delete, including all its children.</desc> 6944 </param> 6945 <param name="progress" type="IProgress" dir="return"> 6946 <desc>Progress object to track the operation completion.</desc> 6947 </param> 6948 </method> 6949 6950 <method name="deleteSnapshotRange"> 6951 <desc> 6952 Starts deleting the specified snapshot range. This is limited to 6953 linear snapshot lists, which means there may not be any other child 6954 snapshots other than the direct sequence between the start and end 6955 snapshot. If the start and end snapshot point to the same snapshot this 6956 method is completely equivalent to <link to="#deleteSnapshot"/>. See 6957 <link to="ISnapshot" /> for an introduction to snapshots. The 6958 conditions and many details are the same as with 6959 <link to="#deleteSnapshot"/>. 6960 6961 This operation is generally faster than deleting snapshots one by one 6962 and often also needs less extra disk space before freeing up disk space 6963 by deleting the removed disk images corresponding to the snapshot. 6964 6965 <note>This API method is right now not implemented!</note> 6966 6967 <result name="VBOX_E_INVALID_VM_STATE"> 6968 The running virtual machine prevents deleting this snapshot. This 6969 happens only in very specific situations, usually snapshots can be 6970 deleted without trouble while a VM is running. The error message 6971 text explains the reason for the failure. 6972 </result> 6973 <result name="E_NOTIMPL"> 6974 The method is not implemented yet. 6975 </result> 6976 </desc> 6977 <param name="startId" type="uuid" mod="string" dir="in"> 6978 <desc>UUID of the first snapshot to delete.</desc> 6979 </param> 6980 <param name="endId" type="uuid" mod="string" dir="in"> 6981 <desc>UUID of the last snapshot to delete.</desc> 6939 6982 </param> 6940 6983 <param name="progress" type="IProgress" dir="return"> -
trunk/src/VBox/Main/include/ConsoleImpl.h
r37813 r37851 157 157 STDMETHOD(DeleteSnapshot)(IN_BSTR aId, IProgress **aProgress); 158 158 STDMETHOD(DeleteSnapshotAndAllChildren)(IN_BSTR aId, IProgress **aProgress); 159 STDMETHOD(DeleteSnapshotRange)(IN_BSTR aStartId, IN_BSTR aEndId, IProgress **aProgress); 159 160 STDMETHOD(RestoreSnapshot)(ISnapshot *aSnapshot, IProgress **aProgress); 160 161 STDMETHOD(Teleport)(IN_BSTR aHostname, ULONG aPort, IN_BSTR aPassword, ULONG aMaxDowntime, IProgress **aProgress); -
trunk/src/VBox/Main/include/MachineImpl.h
r37824 r37851 991 991 BSTR *aStateFilePath); 992 992 STDMETHOD(EndTakingSnapshot)(BOOL aSuccess); 993 STDMETHOD(DeleteSnapshot)(IConsole *aInitiator, IN_BSTR a Id,994 BOOL fDeleteAllChildren,993 STDMETHOD(DeleteSnapshot)(IConsole *aInitiator, IN_BSTR aStartId, 994 IN_BSTR aEndID, BOOL fDeleteAllChildren, 995 995 MachineState_T *aMachineState, IProgress **aProgress); 996 996 STDMETHOD(FinishOnlineMergeMedium)(IMediumAttachment *aMediumAttachment, -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r37843 r37851 3247 3247 3248 3248 MachineState_T machineState = MachineState_Null; 3249 HRESULT rc = mControl->DeleteSnapshot(this, aId, FALSE /* fDeleteAllChildren */, &machineState, aProgress);3249 HRESULT rc = mControl->DeleteSnapshot(this, aId, aId, FALSE /* fDeleteAllChildren */, &machineState, aProgress); 3250 3250 if (FAILED(rc)) return rc; 3251 3251 … … 3270 3270 3271 3271 MachineState_T machineState = MachineState_Null; 3272 HRESULT rc = mControl->DeleteSnapshot(this, aId, TRUE /* fDeleteAllChildren */, &machineState, aProgress); 3272 HRESULT rc = mControl->DeleteSnapshot(this, aId, aId, TRUE /* fDeleteAllChildren */, &machineState, aProgress); 3273 if (FAILED(rc)) return rc; 3274 3275 setMachineStateLocally(machineState); 3276 return S_OK; 3277 } 3278 3279 STDMETHODIMP Console::DeleteSnapshotRange(IN_BSTR aStartId, IN_BSTR aEndId, IProgress **aProgress) 3280 { 3281 CheckComArgExpr(aStartId, Guid(aStartId).isEmpty() == false); 3282 CheckComArgExpr(aEndId, Guid(aEndId).isEmpty() == false); 3283 CheckComArgOutPointerValid(aProgress); 3284 3285 AutoCaller autoCaller(this); 3286 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 3287 3288 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 3289 3290 if (Global::IsTransient(mMachineState)) 3291 return setError(VBOX_E_INVALID_VM_STATE, 3292 tr("Cannot delete a snapshot of the machine while it is changing the state (machine state: %s)"), 3293 Global::stringifyMachineState(mMachineState)); 3294 3295 MachineState_T machineState = MachineState_Null; 3296 HRESULT rc = mControl->DeleteSnapshot(this, aStartId, aEndId, FALSE /* fDeleteAllChildren */, &machineState, aProgress); 3273 3297 if (FAILED(rc)) return rc; 3274 3298 -
trunk/src/VBox/Main/src-server/SnapshotImpl.cpp
r37449 r37851 2014 2014 */ 2015 2015 STDMETHODIMP SessionMachine::DeleteSnapshot(IConsole *aInitiator, 2016 IN_BSTR aId, 2016 IN_BSTR aStartId, 2017 IN_BSTR aEndId, 2017 2018 BOOL fDeleteAllChildren, 2018 2019 MachineState_T *aMachineState, … … 2021 2022 LogFlowThisFuncEnter(); 2022 2023 2023 Guid id(aId); 2024 AssertReturn(aInitiator && !id.isEmpty(), E_INVALIDARG); 2024 Guid startId(aStartId); 2025 Guid endId(aEndId); 2026 AssertReturn(aInitiator && !startId.isEmpty() && !endId.isEmpty(), E_INVALIDARG); 2025 2027 AssertReturn(aMachineState && aProgress, E_POINTER); 2026 2028 2027 /** @todo implement the "and all children" variant*/2028 if (fDeleteAllChildren )2029 /** @todo implement the "and all children" and "range" variants */ 2030 if (fDeleteAllChildren || startId != endId) 2029 2031 ReturnComNotImplemented(); 2030 2032 … … 2047 2049 2048 2050 ComObjPtr<Snapshot> pSnapshot; 2049 HRESULT rc = findSnapshotById( id, pSnapshot, true /* aSetError */);2051 HRESULT rc = findSnapshotById(startId, pSnapshot, true /* aSetError */); 2050 2052 if (FAILED(rc)) return rc; 2051 2053
Note:
See TracChangeset
for help on using the changeset viewer.