VirtualBox

Changeset 102113 in vbox


Ignore:
Timestamp:
Nov 15, 2023 4:23:52 PM (14 months ago)
Author:
vboxsync
Message:

Main: Added IPlatformProperties::getSupportedBootDevices(), so that API clients know which boot devices actually are supported for a particular platform. This also returns the supported boot devices in the default order (was hardcoded in FE/Qt). bugref:10384

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

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

    r102101 r102113  
    1272312723    name="IPlatformProperties"
    1272412724    extends="$unknown"
    12725     uuid="25cf8416-1e5b-4d01-ae9d-1dc34ef737c8"
     12725    uuid="45def725-ab32-4a0a-a85e-fae56249d547"
    1272612726    wsmap="managed"
    1272712727    rest="managed"
     
    1284112841        Returns an array of officially supported values for enum <link to="AudioControllerType"/>,
    1284212842        in the sense of what is e.g. worth offering in the VirtualBox GUI.
     12843      </desc>
     12844    </attribute>
     12845
     12846    <attribute name="supportedBootDevices" type="DeviceType" safearray="yes" readonly="yes">
     12847      <desc>
     12848        Returns an array of officially supported boot devices for enum <link to="DeviceType"/>,
     12849        in the sense of what is e.g. worth offering in the VirtualBox GUI.
     12850
     12851        The returned array also defines the default boot device order for all supported devices.
    1284312852      </desc>
    1284412853    </attribute>
  • trunk/src/VBox/Main/include/PlatformPropertiesImpl.h

    r101756 r102113  
    8686    HRESULT getSupportedUSBControllerTypes(std::vector<USBControllerType_T> &aSupportedUSBControllerTypes) RT_OVERRIDE;
    8787    HRESULT getSupportedAudioControllerTypes(std::vector<AudioControllerType_T> &aSupportedAudioControllerTypes) RT_OVERRIDE;
     88    HRESULT getSupportedBootDevices(std::vector<DeviceType_T> &aSupportedBootDevices);
    8889    HRESULT getSupportedStorageBuses(std::vector<StorageBus_T> &aSupportedStorageBuses) RT_OVERRIDE;
    8990    HRESULT getSupportedStorageControllerTypes(std::vector<StorageControllerType_T> &aSupportedStorageControllerTypes) RT_OVERRIDE;
  • trunk/src/VBox/Main/src-all/PlatformPropertiesImpl.cpp

    r101756 r102113  
    859859}
    860860
     861HRESULT PlatformProperties::getSupportedBootDevices(std::vector<DeviceType_T> &aSupportedBootDevices)
     862{
     863    /* Note: This function returns the supported boot devices for the given architecture,
     864             in the default order, to keep it simple for the caller. */
     865
     866    switch (mPlatformArchitecture)
     867    {
     868        case PlatformArchitecture_x86:
     869        {
     870            static const DeviceType_T aBootDevices[] =
     871            {
     872                DeviceType_Floppy,
     873                DeviceType_DVD,
     874                DeviceType_HardDisk,
     875                DeviceType_Network
     876            };
     877            aSupportedBootDevices.assign(aBootDevices,
     878                                         aBootDevices + RT_ELEMENTS(aBootDevices));
     879            break;
     880        }
     881
     882        case PlatformArchitecture_ARM:
     883        {
     884            static const DeviceType_T aBootDevices[] =
     885            {
     886                DeviceType_DVD,
     887                DeviceType_HardDisk
     888                /** @todo BUGBUG We need to test network booting via PXE on ARM first! */
     889            };
     890            aSupportedBootDevices.assign(aBootDevices,
     891                                         aBootDevices + RT_ELEMENTS(aBootDevices));
     892            break;
     893        }
     894
     895        default:
     896            AssertFailedStmt(aSupportedBootDevices.clear());
     897            break;
     898    }
     899
     900    return S_OK;
     901}
     902
    861903HRESULT PlatformProperties::getSupportedStorageBuses(std::vector<StorageBus_T> &aSupportedStorageBuses)
    862904{
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