VirtualBox

Changeset 50033 in vbox


Ignore:
Timestamp:
Jan 8, 2014 3:22:01 PM (11 years ago)
Author:
vboxsync
Message:

ConsoleImpl: load transient shared folders from saved state

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r49949 r50033  
    67086708            progressDesc = tr("Starting virtual machine");
    67096709
     6710        Bstr savedStateFile;
     6711
     6712        /*
     6713         * Saved VMs will have to prove that their saved states seem kosher.
     6714         */
     6715        if (mMachineState == MachineState_Saved)
     6716        {
     6717            rc = mMachine->COMGETTER(StateFilePath)(savedStateFile.asOutParam());
     6718            if (FAILED(rc))
     6719                throw rc;
     6720            ComAssertRet(!savedStateFile.isEmpty(), E_FAIL);
     6721            int vrc = SSMR3ValidateFile(Utf8Str(savedStateFile).c_str(), false /* fChecksumIt */);
     6722            if (RT_FAILURE(vrc))
     6723                throw setError(VBOX_E_FILE_ERROR,
     6724                               tr("VM cannot start because the saved state file '%ls' is invalid (%Rrc). Delete the saved state prior to starting the VM"),
     6725                               savedStateFile.raw(), vrc);
     6726        }
     6727
     6728        /* Read console data, including console shared folders, stored in the
     6729         * saved state file (if not yet done).
     6730         */
     6731        rc = loadDataFromSavedState();
     6732        if (FAILED(rc))
     6733            throw rc;
     6734
    67106735        /* Check all types of shared folders and compose a single list */
    67116736        SharedFolderDataMap sharedFolders;
     
    67416766                                                            pSF->isAutoMounted());
    67426767            }
    6743         }
    6744 
    6745         Bstr savedStateFile;
    6746 
    6747         /*
    6748          * Saved VMs will have to prove that their saved states seem kosher.
    6749          */
    6750         if (mMachineState == MachineState_Saved)
    6751         {
    6752             rc = mMachine->COMGETTER(StateFilePath)(savedStateFile.asOutParam());
    6753             if (FAILED(rc))
    6754                 throw rc;
    6755             ComAssertRet(!savedStateFile.isEmpty(), E_FAIL);
    6756             int vrc = SSMR3ValidateFile(Utf8Str(savedStateFile).c_str(), false /* fChecksumIt */);
    6757             if (RT_FAILURE(vrc))
    6758                 throw setError(VBOX_E_FILE_ERROR,
    6759                                tr("VM cannot start because the saved state file '%ls' is invalid (%Rrc). Delete the saved state prior to starting the VM"),
    6760                                savedStateFile.raw(), vrc);
    67616768        }
    67626769
     
    70237030        }
    70247031#endif // 0
    7025 
    7026         /* Read console data stored in the saved state file (if not yet done) */
    7027         rc = loadDataFromSavedState();
    7028         if (FAILED(rc))
    7029             throw rc;
    70307032
    70317033        /* setup task object and thread to carry out the operation
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