VirtualBox

Changeset 56477 in vbox for trunk


Ignore:
Timestamp:
Jun 17, 2015 2:15:53 PM (10 years ago)
Author:
vboxsync
Message:

Main/StorageController: Eliminate leftovers from the SATA IDE emulation which are not required anymore for a long time now. To avoid bumping the settings version for older configs when read with VBox 5.0 the default config is hardcoded in the settings code

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/settings.h

    r56323 r56477  
    10551055          ulInstance(0),
    10561056          fUseHostIOCache(true),
    1057           fBootable(true),
    1058           lIDE0MasterEmulationPort(0),
    1059           lIDE0SlaveEmulationPort(0),
    1060           lIDE1MasterEmulationPort(0),
    1061           lIDE1SlaveEmulationPort(0)
     1057          fBootable(true)
    10621058    {}
    10631059
  • trunk/src/VBox/Main/include/StorageControllerImpl.h

    r56035 r56477  
    5656    void i_rollback();
    5757    void i_commit();
    58     HRESULT i_getIDEEmulationPort (LONG DevicePosition, LONG *aPortNumber);
    59     HRESULT i_setIDEEmulationPort (LONG DevicePosition, LONG aPortNumber);
    6058
    6159    // public methods for internal purposes only
  • trunk/src/VBox/Main/src-server/MachineImpl.cpp

    r56035 r56477  
    91259125        rc = pCtl->COMSETTER(UseHostIOCache)(ctlData.fUseHostIOCache);
    91269126        if (FAILED(rc)) return rc;
    9127 
    9128         /* Set IDE emulation settings (only for AHCI controller). */
    9129         if (ctlData.controllerType == StorageControllerType_IntelAhci)
    9130         {
    9131             if (    (FAILED(rc = pCtl->i_setIDEEmulationPort(0, ctlData.lIDE0MasterEmulationPort)))
    9132                  || (FAILED(rc = pCtl->i_setIDEEmulationPort(1, ctlData.lIDE0SlaveEmulationPort)))
    9133                  || (FAILED(rc = pCtl->i_setIDEEmulationPort(2, ctlData.lIDE1MasterEmulationPort)))
    9134                  || (FAILED(rc = pCtl->i_setIDEEmulationPort(3, ctlData.lIDE1SlaveEmulationPort)))
    9135                )
    9136                 return rc;
    9137         }
    91389127
    91399128        /* Load the attached devices now. */
     
    1039710386        ctl.fUseHostIOCache = !!fUseHostIOCache;
    1039810387
    10399         /* Save IDE emulation settings. */
    10400         if (ctl.controllerType == StorageControllerType_IntelAhci)
    10401         {
    10402             if (    (FAILED(rc = pCtl->i_getIDEEmulationPort(0, (LONG*)&ctl.lIDE0MasterEmulationPort)))
    10403                  || (FAILED(rc = pCtl->i_getIDEEmulationPort(1, (LONG*)&ctl.lIDE0SlaveEmulationPort)))
    10404                  || (FAILED(rc = pCtl->i_getIDEEmulationPort(2, (LONG*)&ctl.lIDE1MasterEmulationPort)))
    10405                  || (FAILED(rc = pCtl->i_getIDEEmulationPort(3, (LONG*)&ctl.lIDE1SlaveEmulationPort)))
    10406                )
    10407                 ComAssertComRCRet(rc, rc);
    10408         }
    10409 
    1041010388        /* save the devices now. */
    1041110389        rc = i_saveStorageDevices(pCtl, ctl);
  • trunk/src/VBox/Main/src-server/StorageControllerImpl.cpp

    r56035 r56477  
    5050          mPortCount(2),
    5151          fUseHostIOCache(true),
    52           fBootable(false),
    53           mPortIde0Master(0),
    54           mPortIde0Slave(1),
    55           mPortIde1Master(2),
    56           mPortIde1Slave(3)
     52          fBootable(false)
    5753    { }
    5854
     
    7167    /** Whether it is possible to boot from disks attached to this controller. */
    7268    BOOL fBootable;
    73 
    74     /** The following is only for the SATA controller atm. */
    75     /** Port which acts as primary master for ide emulation. */
    76     ULONG mPortIde0Master;
    77     /** Port which acts as primary slave for ide emulation. */
    78     ULONG mPortIde0Slave;
    79     /** Port which acts as secondary master for ide emulation. */
    80     ULONG mPortIde1Master;
    81     /** Port which acts as secondary slave for ide emulation. */
    82     ULONG mPortIde1Slave;
    8369};
    8470
     
    659645/////////////////////////////////////////////////////////////////////////////
    660646
    661 HRESULT StorageController::i_getIDEEmulationPort(LONG DevicePosition, LONG *aPortNumber)
    662 {
    663     CheckComArgOutPointerValid(aPortNumber);
    664 
    665     AutoCaller autoCaller(this);
    666     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    667 
    668     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    669 
    670     if (m->bd->mStorageControllerType != StorageControllerType_IntelAhci)
    671         return setError(E_NOTIMPL,
    672                         tr("Invalid controller type"));
    673 
    674     switch (DevicePosition)
    675     {
    676         case 0:
    677             *aPortNumber = m->bd->mPortIde0Master;
    678             break;
    679         case 1:
    680             *aPortNumber = m->bd->mPortIde0Slave;
    681             break;
    682         case 2:
    683             *aPortNumber = m->bd->mPortIde1Master;
    684             break;
    685         case 3:
    686             *aPortNumber = m->bd->mPortIde1Slave;
    687             break;
    688         default:
    689             return E_INVALIDARG;
    690     }
    691 
    692     return S_OK;
    693 }
    694 
    695 HRESULT StorageController::i_setIDEEmulationPort(LONG DevicePosition, LONG aPortNumber)
    696 {
    697     AutoCaller autoCaller(this);
    698     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    699 
    700     /* the machine needs to be mutable */
    701     AutoMutableStateDependency adep(m->pParent);
    702     if (FAILED(adep.rc())) return adep.rc();
    703     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    704 
    705     if (m->bd->mStorageControllerType != StorageControllerType_IntelAhci)
    706         return setError(E_NOTIMPL,
    707                         tr("Invalid controller type"));
    708 
    709     if (aPortNumber < 0 || aPortNumber >= 30)
    710         return setError(E_INVALIDARG,
    711                         tr("Invalid port number: %ld (must be in range [%lu, %lu])"),
    712                         aPortNumber, 0, 29);
    713 
    714     switch (DevicePosition)
    715     {
    716         case 0:
    717             m->bd->mPortIde0Master = aPortNumber;
    718             break;
    719         case 1:
    720             m->bd->mPortIde0Slave = aPortNumber;
    721             break;
    722         case 2:
    723             m->bd->mPortIde1Master = aPortNumber;
    724             break;
    725         case 3:
    726             m->bd->mPortIde1Slave = aPortNumber;
    727             break;
    728         default:
    729             return E_INVALIDARG;
    730     }
    731 
    732     return S_OK;
    733 }
    734 
    735647const Utf8Str& StorageController::i_getName() const
    736648{
  • trunk/src/VBox/Main/xml/Settings.cpp

    r56100 r56477  
    21262126                  && (ulInstance                == s.ulInstance)
    21272127                  && (fUseHostIOCache           == s.fUseHostIOCache)
    2128                   && (lIDE0MasterEmulationPort  == s.lIDE0MasterEmulationPort)
    2129                   && (lIDE0SlaveEmulationPort   == s.lIDE0SlaveEmulationPort)
    2130                   && (lIDE1MasterEmulationPort  == s.lIDE1MasterEmulationPort)
    2131                   && (lIDE1SlaveEmulationPort   == s.lIDE1SlaveEmulationPort)
    21322128                  && (llAttachedDevices         == s.llAttachedDevices)
    21332129                )
     
    27202716{
    27212717    elmStorageController.getAttributeValue("PortCount", sctl.ulPortCount);
    2722     elmStorageController.getAttributeValue("IDE0MasterEmulationPort", sctl.lIDE0MasterEmulationPort);
    2723     elmStorageController.getAttributeValue("IDE0SlaveEmulationPort", sctl.lIDE0SlaveEmulationPort);
    2724     elmStorageController.getAttributeValue("IDE1MasterEmulationPort", sctl.lIDE1MasterEmulationPort);
    2725     elmStorageController.getAttributeValue("IDE1SlaveEmulationPort", sctl.lIDE1SlaveEmulationPort);
    2726 
    27272718    elmStorageController.getAttributeValue("useHostIOCache", sctl.fUseHostIOCache);
    27282719}
     
    50635054        if (sc.controllerType == StorageControllerType_IntelAhci)
    50645055        {
    5065             pelmController->setAttribute("IDE0MasterEmulationPort", sc.lIDE0MasterEmulationPort);
    5066             pelmController->setAttribute("IDE0SlaveEmulationPort", sc.lIDE0SlaveEmulationPort);
    5067             pelmController->setAttribute("IDE1MasterEmulationPort", sc.lIDE1MasterEmulationPort);
    5068             pelmController->setAttribute("IDE1SlaveEmulationPort", sc.lIDE1SlaveEmulationPort);
     5056            pelmController->setAttribute("IDE0MasterEmulationPort", 0);
     5057            pelmController->setAttribute("IDE0SlaveEmulationPort", 1);
     5058            pelmController->setAttribute("IDE1MasterEmulationPort", 2);
     5059            pelmController->setAttribute("IDE1SlaveEmulationPort", 3);
    50695060        }
    50705061
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