Changeset 78825 in vbox for trunk/src/VBox/Main/src-server
- Timestamp:
- May 28, 2019 3:59:04 PM (6 years ago)
- Location:
- trunk/src/VBox/Main/src-server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/SnapshotImpl.cpp
r78766 r78825 2184 2184 Guid snapshotId; 2185 2185 std::set<ComObjPtr<Medium> > pMediumsForNotify; 2186 std::map<Guid, DeviceType_T> uIdsForNotify;2186 std::map<Guid, std::pair<DeviceType_T, BOOL>> uIdsForNotify; 2187 2187 2188 2188 try … … 2311 2311 { 2312 2312 pMediumsForNotify.insert(pMedium->i_getParent()); 2313 uIdsForNotify[pMedium->i_getId()] = pMedium->i_getDeviceType();2313 uIdsForNotify[pMedium->i_getId()] = std::pair<DeviceType_T, BOOL>(pMedium->i_getDeviceType(), TRUE); 2314 2314 } 2315 2315 } … … 2422 2422 { 2423 2423 pMediumsForNotify.insert(pParent); 2424 uIdsForNotify[pMedium->i_getId()] = std::pair<DeviceType_T, BOOL>(pMedium->i_getDeviceType(), FALSE); 2424 2425 pMedium->uninit(); 2425 2426 } … … 2452 2453 { 2453 2454 mParent->i_onSnapshotRestored(mData->mUuid, snapshotId); 2454 for (std::map<Guid, DeviceType_T>::const_iterator it = uIdsForNotify.begin();2455 for (std::map<Guid, std::pair<DeviceType_T, BOOL>>::const_iterator it = uIdsForNotify.begin(); 2455 2456 it != uIdsForNotify.end(); 2456 2457 ++it) 2457 2458 { 2458 mParent->i_onMediumRegistered(it->first, it->second , TRUE);2459 mParent->i_onMediumRegistered(it->first, it->second.first, it->second.second); 2459 2460 } 2460 2461 for (std::set<ComObjPtr<Medium> >::const_iterator it = pMediumsForNotify.begin(); -
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
r78763 r78825 758 758 AutoWriteLock treeLock(i_getMediaTreeLockHandle() COMMA_LOCKVAL_SRC_POS); 759 759 760 std::map<Guid, DeviceType_T> uIdsForNotify; 761 760 762 HRESULT rc = S_OK; 761 763 settings::MediaList::const_iterator it; … … 778 780 779 781 rc = i_registerMedium(pHardDisk, &pHardDisk, treeLock); 782 if (SUCCEEDED(rc)) 783 uIdsForNotify[pHardDisk->i_getId()] = DeviceType_HardDisk; 780 784 // Avoid trouble with lock/refcount, before returning or not. 781 785 treeLock.release(); … … 803 807 804 808 rc = i_registerMedium(pImage, &pImage, treeLock); 809 if (SUCCEEDED(rc)) 810 uIdsForNotify[pImage->i_getId()] = DeviceType_DVD; 805 811 // Avoid trouble with lock/refcount, before returning or not. 806 812 treeLock.release(); … … 828 834 829 835 rc = i_registerMedium(pImage, &pImage, treeLock); 836 if (SUCCEEDED(rc)) 837 uIdsForNotify[pImage->i_getId()] = DeviceType_Floppy; 830 838 // Avoid trouble with lock/refcount, before returning or not. 831 839 treeLock.release(); … … 833 841 treeLock.acquire(); 834 842 if (FAILED(rc)) return rc; 843 } 844 845 if (SUCCEEDED(rc)) 846 { 847 for (std::map<com::Guid, DeviceType_T>::const_iterator it = uIdsForNotify.begin(); 848 it != uIdsForNotify.end(); 849 ++it) 850 { 851 i_onMediumRegistered(it->first, it->second, TRUE); 852 } 835 853 } 836 854
Note:
See TracChangeset
for help on using the changeset viewer.