VirtualBox

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


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
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r49986 r50291  
    88888888    name="ISystemProperties"
    88898889    extends="$unknown"
    8890     uuid="1254a96a-ae57-4484-946a-22d86c1f98af"
     8890    uuid="29c295a2-346e-42cf-92c0-8db515d75397"
    88918891    wsmap="managed"
    88928892    >
     
    93029302      <param name="enabled" type="boolean" dir="return">
    93039303        <desc>Returned flag indicating the default value</desc>
     9304      </param>
     9305    </method>
     9306
     9307    <method name="getStorageControllerHotplugCapable">
     9308      <desc>Returns whether the given storage controller supports
     9309        hot-plugging devices.</desc>
     9310
     9311      <param name="controllerType" type="StorageControllerType" dir="in">
     9312        <desc>The storage controller to check for.</desc>
     9313      </param>
     9314
     9315      <param name="hotplugCapable" type="boolean" dir="return">
     9316        <desc>Returned flag indicating whether the controller is hotplug capable</desc>
    93049317      </param>
    93059318    </method>
  • 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