third_party/virtualbox/src/VBox/Main/src-server/MachineImpl.cpp
/**
 *  Saves the storage controller configuration.
 *
 *  @param data    storage settings.
 */
Saves the storage controller configuration.
@param data    storage settings.
Saves the storage controller configuration . @param data storage settings .
HRESULT Machine::i_saveStorageControllers(settings::Storage &data)
{
    data.llStorageControllers.clear();
    for (StorageControllerList::const_iterator
         it = mStorageControllers->begin();
         it != mStorageControllers->end();
         ++it)
    {
        HRESULT rc;
        ComObjPtr<StorageController> pCtl = *it;
        settings::StorageController ctl;
        ctl.strName = pCtl->i_getName();
        ctl.controllerType = pCtl->i_getControllerType();
        ctl.storageBus = pCtl->i_getStorageBus();
        ctl.ulInstance = pCtl->i_getInstance();
        ctl.fBootable = pCtl->i_getBootable();
        ULONG portCount;
        rc = pCtl->COMGETTER(PortCount)(&portCount);
        ComAssertComRCRet(rc, rc);
        ctl.ulPortCount = portCount;
        BOOL fUseHostIOCache;
        rc = pCtl->COMGETTER(UseHostIOCache)(&fUseHostIOCache);
        ComAssertComRCRet(rc, rc);
        ctl.fUseHostIOCache = !!fUseHostIOCache;
        rc = i_saveStorageDevices(pCtl, ctl);
        ComAssertComRCRet(rc, rc);
        data.llStorageControllers.push_back(ctl);
    }
    return S_OK;
}
HRESULT Machine :: i_saveStorageControllers ( settings :: Storage & data ) { data . llStorageControllers . clear ( ) ; for ( StorageControllerList :: const_iterator it = mStorageControllers -> begin ( ) ; it != mStorageControllers -> end ( ) ; ++ it ) { HRESULT rc ; ComObjPtr < StorageController > pCtl = * it ; settings :: StorageController ctl ; ctl . strName = pCtl -> i_getName ( ) ; ctl . controllerType = pCtl -> i_getControllerType ( ) ; ctl . storageBus = pCtl -> i_getStorageBus ( ) ; ctl . ulInstance = pCtl -> i_getInstance ( ) ; ctl . fBootable = pCtl -> i_getBootable ( ) ; ULONG portCount ; rc = pCtl -> COMGETTER ( PortCount ) ( & portCount ) ; ComAssertComRCRet ( rc , rc ) ; ctl . ulPortCount = portCount ; BOOL fUseHostIOCache ; rc = pCtl -> COMGETTER ( UseHostIOCache ) ( & fUseHostIOCache ) ; ComAssertComRCRet ( rc , rc ) ; ctl . fUseHostIOCache = ! ! fUseHostIOCache ; rc = i_saveStorageDevices ( pCtl , ctl ) ; ComAssertComRCRet ( rc , rc ) ; data . llStorageControllers . push_back ( ctl ) ; } return S_OK ; }
Saves the storage controller configuration.
Saves the storage controller configuration .
/* Save the port count. */ /* Save fUseHostIOCache */ /* save the devices now. */