Changeset 70236 in vbox
- Timestamp:
- Dec 20, 2017 11:49:17 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/SnapshotImpl.cpp
r68986 r70236 2875 2875 2876 2876 { 2877 /* check available place on the storage*/2877 /* check available space on the storage */ 2878 2878 RTFOFF pcbTotal = 0; 2879 2879 RTFOFF pcbFree = 0; 2880 2880 uint32_t pcbBlock = 0; 2881 2881 uint32_t pcbSector = 0; 2882 std::multimap<uint32_t, uint64_t> neededStorageFreeSpace;2883 std::map<uint32_t, const char*> serialMapToStoragePath;2882 std::multimap<uint32_t, uint64_t> neededStorageFreeSpace; 2883 std::map<uint32_t, const char*> serialMapToStoragePath; 2884 2884 2885 2885 for (MediumDeleteRecList::const_iterator … … 2917 2917 pSource_local->COMGETTER(Size)((LONG64*)&diskSize); 2918 2918 2919 /** @todo r=klaus this is too pessimistic... should take 2920 * the current size and maximum size of the target image 2921 * into account, because a X GB image with Y GB capacity 2922 * can only grow by Y-X GB (ignoring overhead, which 2923 * unfortunately is hard to estimate, some have next to 2924 * nothing, some have a certain percentage...) */ 2919 2925 /* store needed free space in multimap */ 2920 neededStorageFreeSpace.insert(std::make_pair(pu32Serial, diskSize));2926 neededStorageFreeSpace.insert(std::make_pair(pu32Serial, diskSize)); 2921 2927 /* linking storage UID with snapshot path, it is a helper container (just for easy finding needed path) */ 2922 serialMapToStoragePath.insert(std::make_pair(pu32Serial, pTarget_local->i_getLocationFull().c_str()));2928 serialMapToStoragePath.insert(std::make_pair(pu32Serial, pTarget_local->i_getLocationFull().c_str())); 2923 2929 } 2924 2930 } … … 2929 2935 uint64_t commonSourceStoragesSize = 0; 2930 2936 2931 /* find all records in multimap with identical storage UID */2937 /* find all records in multimap with identical storage UID */ 2932 2938 ret = neededStorageFreeSpace.equal_range(neededStorageFreeSpace.begin()->first); 2933 2939 std::multimap<uint32_t,uint64_t>::const_iterator it_ns = ret.first; … … 2938 2944 } 2939 2945 2940 /* find appropriate path by storage UID */2946 /* find appropriate path by storage UID */ 2941 2947 std::map<uint32_t,const char*>::const_iterator it_sm = serialMapToStoragePath.find(ret.first->first); 2942 2948 /* get info about a storage */ … … 2951 2957 } 2952 2958 2953 int vrc = RTFsQuerySizes(it_sm->second, &pcbTotal, &pcbFree, &pcbBlock, &pcbSector);2959 int vrc = RTFsQuerySizes(it_sm->second, &pcbTotal, &pcbFree, &pcbBlock, &pcbSector); 2954 2960 if (RT_FAILURE(vrc)) 2955 2961 {
Note:
See TracChangeset
for help on using the changeset viewer.