VirtualBox

Changeset 43740 in vbox


Ignore:
Timestamp:
Oct 25, 2012 1:57:24 PM (12 years ago)
Author:
vboxsync
Message:

Main/Snapshot: only check free space on filesystems when the target uses file backing

File:
1 edited

Legend:

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

    r43689 r43740  
    25012501                ComObjPtr<Medium> pSource_local = it_md->mpSource;
    25022502                ComObjPtr<Medium> pTarget_local = it_md->mpTarget;
    2503 
    2504                 int vrc = RTFsQuerySerial(pTarget_local->getLocationFull().c_str(), &pu32Serial);
    2505                 if (RT_FAILURE(vrc))
     2503                ComPtr<IMediumFormat> pTargetFormat;
     2504
     2505                rc = pTarget_local->COMGETTER(MediumFormat)(pTargetFormat.asOutParam());
     2506                if (FAILED(rc))
     2507                    throw rc;
     2508                ULONG uTargetCaps = 0;
     2509                rc = pTargetFormat->COMGETTER(Capabilities)(&uTargetCaps);
     2510                if (FAILED(rc))
     2511                    throw rc;
     2512
     2513                if (uTargetCaps & MediumFormatCapabilities_File)
    25062514                {
    2507                     rc = setError(E_FAIL,
    2508                                       tr(" Impossible merging with '%s'. Can't get storage UID."),
     2515                    int vrc = RTFsQuerySerial(pTarget_local->getLocationFull().c_str(), &pu32Serial);
     2516                    if (RT_FAILURE(vrc))
     2517                    {
     2518                        rc = setError(E_FAIL,
     2519                                      tr("Impossible merging with '%s'. Can't get storage UID"),
    25092520                                      pTarget_local->getLocationFull().c_str());
    2510                     throw rc;
     2521                        throw rc;
     2522                    }
     2523
     2524                    pSource_local->COMGETTER(Size)((LONG64*)&diskSize);
     2525
     2526                    /* store needed free space in multimap */
     2527                    neededStorageFreeSpace.insert(std::make_pair(pu32Serial,diskSize));
     2528                    /* linking storage UID with snapshot path, it is a helper container (just for easy finding needed path) */
     2529                    serialMapToStoragePath.insert(std::make_pair(pu32Serial,pTarget_local->getLocationFull().c_str()));
    25112530                }
    25122531
    2513                 pSource_local->COMGETTER(Size)((LONG64*)&diskSize);
    2514 
    2515                 /* store needed free space in multimap */
    2516                 neededStorageFreeSpace.insert(std::make_pair(pu32Serial,diskSize));
    2517                 /* linking storage UID with snapshot path, it is a helper container (just for easy finding needed path) */
    2518                 serialMapToStoragePath.insert(std::make_pair(pu32Serial,pTarget_local->getLocationFull().c_str()));
    25192532                ++it_md;
    25202533            }
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