VirtualBox

Changeset 71309 in vbox


Ignore:
Timestamp:
Mar 13, 2018 9:06:18 AM (7 years ago)
Author:
vboxsync
Message:

bugref:8345. Improved logic updating the path of state files.

File:
1 edited

Legend:

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

    r71197 r71309  
    638638         * Update state file path
    639639         * very important step!
     640         * Not obvious how to do it correctly.
    640641         */
    641642        {
     643            LogRelFunc(("Update state file path\n"));
    642644            rc = taskMoveVM->updatePathsToStateFiles(taskMoveVM->finalSaveStateFilesMap,
    643645                                                     taskMoveVM->vmFolders[VBox_SettingFolder],
     
    10571059    {
    10581060        const SAVESTATETASK &sst = itState->second;
    1059 
    1060         Utf8Str strGuidMachine = sst.snapshotUuid.toString();
    1061         ComObjPtr<Snapshot> snapshotMachineObj;
    1062 
    1063         rc = m_pMachine->i_findSnapshotById(sst.snapshotUuid, snapshotMachineObj, true);
    1064         if (SUCCEEDED(rc) && !snapshotMachineObj.isNull())
    1065         {
    1066             snapshotMachineObj->i_updateSavedStatePaths(sourcePath.c_str(),
    1067                                                         targetPath.c_str());
     1061           
     1062        if (sst.snapshotUuid != Guid::Empty)
     1063        {
     1064            Utf8Str strGuidMachine = sst.snapshotUuid.toString();
     1065            ComObjPtr<Snapshot> snapshotMachineObj;
     1066
     1067            rc = m_pMachine->i_findSnapshotById(sst.snapshotUuid, snapshotMachineObj, true);
     1068            if (SUCCEEDED(rc) && !snapshotMachineObj.isNull())
     1069            {
     1070                snapshotMachineObj->i_updateSavedStatePaths(sourcePath.c_str(),
     1071                                                            targetPath.c_str());
     1072            }
     1073        }
     1074        else
     1075        {
     1076            const Utf8Str &path = m_pMachine->mSSData->strStateFilePath;
     1077            m_pMachine->mSSData->strStateFilePath = Utf8StrFmt("%s%s",
     1078                                                               targetPath.c_str(),
     1079                                                               path.c_str() + sourcePath.length());
    10681080        }
    10691081
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