VirtualBox

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


Ignore:
Timestamp:
May 14, 2019 3:16:21 PM (6 years ago)
Author:
vboxsync
Message:

Main/Machine+StorageController+SystemProperties+Console: Add basic support for virtio-scsi storage controller.

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

Legend:

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

    r78427 r78509  
    60006000{
    60016001    if (   (aConnectionType <= StorageBus_Null)
    6002         || (aConnectionType >  StorageBus_PCIe))
     6002        || (aConnectionType >  StorageBus_VirtioSCSI))
    60036003        return setError(E_INVALIDARG,
    60046004                        tr("Invalid connection type: %d"),
  • trunk/src/VBox/Main/src-server/StorageControllerImpl.cpp

    r78261 r78509  
    9696    ComAssertRet(aParent && !aName.isEmpty(), E_INVALIDARG);
    9797    if (   (aStorageBus <= StorageBus_Null)
    98         || (aStorageBus >  StorageBus_PCIe))
     98        || (aStorageBus >  StorageBus_VirtioSCSI))
    9999        return setError(E_INVALIDARG,
    100100                        tr("Invalid storage connection type"));
     
    162162            m->bd->ulPortCount = 1;
    163163            m->bd->controllerType = StorageControllerType_NVMe;
     164            break;
     165        case StorageBus_VirtioSCSI:
     166            m->bd->ulPortCount = 1;
     167            m->bd->controllerType = StorageControllerType_VirtioSCSI;
    164168            break;
    165169        case StorageBus_Null: break; /* Shut up MSC. */
     
    415419            break;
    416420        }
     421        case StorageBus_VirtioSCSI:
     422        {
     423            if (aControllerType != StorageControllerType_VirtioSCSI)
     424                rc = E_INVALIDARG;
     425            break;
     426        }
    417427        default:
    418428            AssertMsgFailed(("Invalid controller type %d\n", m->bd->storageBus));
     
    560570                                tr("Invalid port count: %lu (must be in range [%lu, %lu])"),
    561571                                aPortCount, 1, 255);
     572            break;
     573        }
     574        case StorageBus_VirtioSCSI:
     575        {
     576            /*
     577             * virtio-scsi supports 256 targets (with 16384 LUNs each).
     578             */
     579            if (aPortCount < 1 || aPortCount > 256)
     580                return setError(E_INVALIDARG,
     581                                tr("Invalid port count: %lu (must be in range [%lu, %lu])"),
     582                                aPortCount, 1, 256);
    562583            break;
    563584        }
  • trunk/src/VBox/Main/src-server/SystemPropertiesImpl.cpp

    r76592 r78509  
    363363        case StorageBus_USB:
    364364        case StorageBus_PCIe:
     365        case StorageBus_VirtioSCSI:
    365366        {
    366367            /* SATA and both SCSI controllers only support one device per port. */
     
    392393        case StorageBus_SAS:
    393394        case StorageBus_PCIe:
     395        case StorageBus_VirtioSCSI:
    394396        {
    395397            *aMinPortCount = 1;
     
    458460        {
    459461            *aMaxPortCount = 8;
     462            break;
     463        }
     464        case StorageBus_VirtioSCSI:
     465        {
     466            *aMaxPortCount = 256;
    460467            break;
    461468        }
     
    480487        case StorageBus_SAS:
    481488        case StorageBus_PCIe:
     489        case StorageBus_VirtioSCSI:
    482490            cCtrs = aChipset == ChipsetType_ICH9 ? 8 : 1;
    483491            break;
     
    511519        case StorageBus_SAS:
    512520        case StorageBus_USB:
     521        case StorageBus_VirtioSCSI:
    513522        {
    514523            aDeviceTypes.resize(2);
     
    548557        case StorageControllerType_USB:
    549558        case StorageControllerType_NVMe:
     559        case StorageControllerType_VirtioSCSI:
    550560            *aEnabled = false;
    551561            break;
     
    575585        case StorageControllerType_BusLogic:
    576586        case StorageControllerType_NVMe:
     587        case StorageControllerType_VirtioSCSI:
    577588        case StorageControllerType_PIIX3:
    578589        case StorageControllerType_PIIX4:
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