Changeset 55728 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- May 7, 2015 1:58:38 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 100140
- Location:
- trunk/src/VBox/Main/src-server
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r55674 r55728 3208 3208 HRESULT Machine::lockMachine(const ComPtr<ISession> &aSession, 3209 3209 LockType_T aLockType) 3210 3211 3210 { 3212 3211 /* check the session state */ … … 3260 3259 3261 3260 // copy pointers to W (the write-locking session) before leaving lock (these must not be NULL) 3262 ComAssertRet(mData->mSession.mLockType == LockType_Write || mData->mSession.mLockType == LockType_VM, E_FAIL);3263 3261 ComPtr<IInternalSessionControl> pSessionW = mData->mSession.mDirectControl; 3264 3262 ComAssertRet(!pSessionW.isNull(), E_FAIL); … … 10008 10006 // a saved state in the current state, so keep everything as is 10009 10007 || ( ( mData->mMachineState == MachineState_Snapshotting 10010 || mData->mMachineState == MachineState_DeletingSnapshot) 10008 || mData->mMachineState == MachineState_DeletingSnapshot 10009 || mData->mMachineState == MachineState_RestoringSnapshot) 10011 10010 && (!mSSData->strStateFilePath.isEmpty()) 10012 10011 ) -
trunk/src/VBox/Main/src-server/MediumImpl.cpp
r55285 r55728 4647 4647 tr("Medium format '%s' does not support storage deletion"), 4648 4648 m->strFormat.c_str()); 4649 4650 /* Wait for a concurrently running Medium::i_queryInfo to complete. */ 4651 /** @todo r=klaus would be great if this could be moved to the async 4652 * part of the operation as it can take quite a while */ 4653 if (m->queryInfoRunning) 4654 { 4655 while (m->queryInfoRunning) 4656 { 4657 multilock.release(); 4658 /* Must not hold the media tree lock or the object lock, as 4659 * Medium::i_queryInfo needs this lock and thus we would run 4660 * into a deadlock here. */ 4661 Assert(!m->pVirtualBox->i_getMediaTreeLockHandle().isWriteLockOnCurrentThread()); 4662 Assert(!isWriteLockOnCurrentThread()); 4663 { 4664 AutoReadLock qlock(m->queryInfoSem COMMA_LOCKVAL_SRC_POS); 4665 } 4666 multilock.acquire(); 4667 } 4668 } 4649 4669 4650 4670 /* Note that we are fine with Inaccessible state too: a) for symmetry -
trunk/src/VBox/Main/src-server/SnapshotImpl.cpp
r55698 r55728 1796 1796 task.m_pProgress->i_notifyComplete(rc); 1797 1797 1798 if (SUCCEEDED(rc)) 1799 mParent->i_onSnapshotTaken(mData->mUuid, 1800 task.m_pSnapshot->i_getId()); 1798 1801 LogFlowThisFuncLeave(); 1799 1802 } … … 1864 1867 /* associate old hard disks with the snapshot and do locking/unlocking*/ 1865 1868 i_commitMedia(task.m_fTakingSnapshotOnline); 1866 1867 /* inform callbacks */1868 mParent->i_onSnapshotTaken(mData->mUuid,1869 task.m_pSnapshot->i_getId());1870 1869 alock.release(); 1871 1870 } … … 2039 2038 2040 2039 HRESULT rc = S_OK; 2041 2042 bool stateRestored = false;2043 2040 2044 2041 try … … 2161 2158 * state accordingly no matter of the delete snapshot result */ 2162 2159 if (mSSData->strStateFilePath.isNotEmpty()) 2163 i_setMachineState(MachineState_Saved);2160 task.modifyBackedUpState(MachineState_Saved); 2164 2161 else 2165 i_setMachineState(MachineState_PoweredOff); 2166 2167 stateRestored = true; 2162 task.modifyBackedUpState(MachineState_PoweredOff); 2168 2163 2169 2164 /* Paranoia: no one must have saved the settings in the mean time. If … … 2252 2247 i_rollback(false /* aNotify */); 2253 2248 2254 if (!stateRestored)2255 {2256 /* restore the machine state */2257 i_setMachineState(task.m_machineStateBackup);2258 }2259 2249 } 2260 2250 2261 2251 mParent->i_saveModifiedRegistries(); 2252 2253 /* restore the machine state */ 2254 i_setMachineState(task.m_machineStateBackup); 2262 2255 2263 2256 /* set the result (this will try to fetch current error info on failure) */
Note:
See TracChangeset
for help on using the changeset viewer.