- Timestamp:
- Jun 17, 2015 2:15:53 PM (10 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/StorageControllerImpl.h
r56035 r56477 56 56 void i_rollback(); 57 57 void i_commit(); 58 HRESULT i_getIDEEmulationPort (LONG DevicePosition, LONG *aPortNumber);59 HRESULT i_setIDEEmulationPort (LONG DevicePosition, LONG aPortNumber);60 58 61 59 // public methods for internal purposes only -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r56035 r56477 9125 9125 rc = pCtl->COMSETTER(UseHostIOCache)(ctlData.fUseHostIOCache); 9126 9126 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 }9138 9127 9139 9128 /* Load the attached devices now. */ … … 10397 10386 ctl.fUseHostIOCache = !!fUseHostIOCache; 10398 10387 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 10410 10388 /* save the devices now. */ 10411 10389 rc = i_saveStorageDevices(pCtl, ctl); -
trunk/src/VBox/Main/src-server/StorageControllerImpl.cpp
r56035 r56477 50 50 mPortCount(2), 51 51 fUseHostIOCache(true), 52 fBootable(false), 53 mPortIde0Master(0), 54 mPortIde0Slave(1), 55 mPortIde1Master(2), 56 mPortIde1Slave(3) 52 fBootable(false) 57 53 { } 58 54 … … 71 67 /** Whether it is possible to boot from disks attached to this controller. */ 72 68 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;83 69 }; 84 70 … … 659 645 ///////////////////////////////////////////////////////////////////////////// 660 646 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 735 647 const Utf8Str& StorageController::i_getName() const 736 648 { -
trunk/src/VBox/Main/xml/Settings.cpp
r56100 r56477 2126 2126 && (ulInstance == s.ulInstance) 2127 2127 && (fUseHostIOCache == s.fUseHostIOCache) 2128 && (lIDE0MasterEmulationPort == s.lIDE0MasterEmulationPort)2129 && (lIDE0SlaveEmulationPort == s.lIDE0SlaveEmulationPort)2130 && (lIDE1MasterEmulationPort == s.lIDE1MasterEmulationPort)2131 && (lIDE1SlaveEmulationPort == s.lIDE1SlaveEmulationPort)2132 2128 && (llAttachedDevices == s.llAttachedDevices) 2133 2129 ) … … 2720 2716 { 2721 2717 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 2727 2718 elmStorageController.getAttributeValue("useHostIOCache", sctl.fUseHostIOCache); 2728 2719 } … … 5063 5054 if (sc.controllerType == StorageControllerType_IntelAhci) 5064 5055 { 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); 5069 5060 } 5070 5061
Note:
See TracChangeset
for help on using the changeset viewer.