third_party/virtualbox/src/VBox/Main/src-server/MachineImpl.cpp
/**
 * Shared code between the various init() implementations.
 * @param   aParent         The VirtualBox object.
 * @param   strConfigFile   Settings file.
 * @return
 */
Shared code between the various init() implementations.
@param   aParent         The VirtualBox object.
@param   strConfigFile   Settings file.
@return
Shared code between the various init () implementations . @param aParent The VirtualBox object . @param strConfigFile Settings file . @return
HRESULT Machine::initImpl(VirtualBox *aParent,
                          const Utf8Str &strConfigFile)
{
    LogFlowThisFuncEnter();
    AssertReturn(aParent, E_INVALIDARG);
    AssertReturn(!strConfigFile.isEmpty(), E_INVALIDARG);
    HRESULT rc = S_OK;
    unconst(mParent) = aParent;
    mData.allocate();
    mData->m_strConfigFile = strConfigFile;
    int vrc1 = mParent->i_calculateFullPath(strConfigFile, mData->m_strConfigFileFull);
    if (RT_FAILURE(vrc1))
        return setError(VBOX_E_FILE_ERROR,
                        tr("Invalid machine settings file name '%s' (%Rrc)"),
                        strConfigFile.c_str(),
                        vrc1);
    LogFlowThisFuncLeave();
    return rc;
}
HRESULT Machine :: initImpl ( VirtualBox * aParent , const Utf8Str & strConfigFile ) { LogFlowThisFuncEnter ( ) ; AssertReturn ( aParent , E_INVALIDARG ) ; AssertReturn ( ! strConfigFile . isEmpty ( ) , E_INVALIDARG ) ; HRESULT rc = S_OK ; unconst ( mParent ) = aParent ; mData . allocate ( ) ; mData -> m_strConfigFile = strConfigFile ; int vrc1 = mParent -> i_calculateFullPath ( strConfigFile , mData -> m_strConfigFileFull ) ; if ( RT_FAILURE ( vrc1 ) ) return setError ( VBOX_E_FILE_ERROR , tr ( " " ) , strConfigFile . c_str ( ) , vrc1 ) ; LogFlowThisFuncLeave ( ) ; return rc ; }
Shared code between the various init() implementations.
Shared code between the various init () implementations .
/* share the parent weakly */ /* allocate the essential machine data structure (the rest will be
     * allocated later by initDataAndChildObjects() */ /* memorize the config file name (as provided) */ /* get the full file name */