VirtualBox

Changeset 50291 in vbox for trunk/src/VBox/Main/src-server


Ignore:
Timestamp:
Jan 30, 2014 4:22:55 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
91946
Message:

Main/SystemProperties: Add GetStorageControllerHotplugCapable to check whether a given controller type is hotplug capable

Location:
trunk/src/VBox/Main/src-server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/MachineImpl.cpp

    r49983 r50291  
    1252712527bool Machine::isControllerHotplugCapable(StorageControllerType_T enmCtrlType)
    1252812528{
    12529     switch (enmCtrlType)
    12530     {
    12531         case StorageControllerType_IntelAhci:
    12532         case StorageControllerType_USB:
    12533             return true;
    12534         case StorageControllerType_LsiLogic:
    12535         case StorageControllerType_LsiLogicSas:
    12536         case StorageControllerType_BusLogic:
    12537         case StorageControllerType_PIIX3:
    12538         case StorageControllerType_PIIX4:
    12539         case StorageControllerType_ICH6:
    12540         case StorageControllerType_I82078:
    12541         default:
    12542             return false;
    12543     }
     12529    ComPtr<ISystemProperties> systemProperties;
     12530    HRESULT rc = mParent->COMGETTER(SystemProperties)(systemProperties.asOutParam());
     12531    if (FAILED(rc))
     12532        return false;
     12533
     12534    BOOL aHotplugCapable = FALSE;
     12535    systemProperties->COMGETTER(StorageControllerHotplugCapable)(enmCtrlType, &aHotplugCapable);
     12536
     12537    return RT_BOOL(aHotplugCapable);
    1254412538}
    1254512539
  • trunk/src/VBox/Main/src-server/SystemPropertiesImpl.cpp

    r49951 r50291  
    538538}
    539539
     540HRESULT SystemProperties::getStorageControllerHotplugCapable(StorageControllerType_T aControllerType,
     541                                                             BOOL *aHotplugCapable)
     542{
     543    switch (aControllerType)
     544    {
     545        case StorageControllerType_IntelAhci:
     546        case StorageControllerType_USB:
     547            *aHotplugCapable = true;
     548            break;
     549        case StorageControllerType_LsiLogic:
     550        case StorageControllerType_LsiLogicSas:
     551        case StorageControllerType_BusLogic:
     552        case StorageControllerType_PIIX3:
     553        case StorageControllerType_PIIX4:
     554        case StorageControllerType_ICH6:
     555        case StorageControllerType_I82078:
     556            *aHotplugCapable = false;
     557            break;
     558        default:
     559            AssertMsgFailedReturn(("Invalid controller type %d\n", aControllerType), E_FAIL);
     560    }
     561
     562    return S_OK;
     563}
     564
    540565HRESULT SystemProperties::getMaxInstancesOfUSBControllerType(ChipsetType_T aChipset,
    541566                                                             USBControllerType_T aType,
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette