VirtualBox

Changeset 70236 in vbox


Ignore:
Timestamp:
Dec 20, 2017 11:49:17 AM (7 years ago)
Author:
vboxsync
Message:

Main/Snapshot: coding style whitespace cleanup, adding a todo explaining why the current disk space estimate for image merging is too pessimistic

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/SnapshotImpl.cpp

    r68986 r70236  
    28752875
    28762876        {
    2877             /*check available place on the storage*/
     2877            /* check available space on the storage */
    28782878            RTFOFF pcbTotal = 0;
    28792879            RTFOFF pcbFree = 0;
    28802880            uint32_t pcbBlock = 0;
    28812881            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;
    28842884
    28852885            for (MediumDeleteRecList::const_iterator
     
    29172917                    pSource_local->COMGETTER(Size)((LONG64*)&diskSize);
    29182918
     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...) */
    29192925                    /* store needed free space in multimap */
    2920                     neededStorageFreeSpace.insert(std::make_pair(pu32Serial,diskSize));
     2926                    neededStorageFreeSpace.insert(std::make_pair(pu32Serial, diskSize));
    29212927                    /* 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()));
    29232929                }
    29242930            }
     
    29292935                uint64_t commonSourceStoragesSize = 0;
    29302936
    2931                 /* find all records in multimap with identical storage UID*/
     2937                /* find all records in multimap with identical storage UID */
    29322938                ret = neededStorageFreeSpace.equal_range(neededStorageFreeSpace.begin()->first);
    29332939                std::multimap<uint32_t,uint64_t>::const_iterator it_ns = ret.first;
     
    29382944                }
    29392945
    2940                 /* find appropriate path by storage UID*/
     2946                /* find appropriate path by storage UID */
    29412947                std::map<uint32_t,const char*>::const_iterator it_sm = serialMapToStoragePath.find(ret.first->first);
    29422948                /* get info about a storage */
     
    29512957                }
    29522958
    2953                 int vrc = RTFsQuerySizes(it_sm->second, &pcbTotal, &pcbFree,&pcbBlock, &pcbSector);
     2959                int vrc = RTFsQuerySizes(it_sm->second, &pcbTotal, &pcbFree, &pcbBlock, &pcbSector);
    29542960                if (RT_FAILURE(vrc))
    29552961                {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette