VirtualBox

Changeset 24241 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Nov 2, 2009 9:54:26 AM (15 years ago)
Author:
vboxsync
Message:

DrvSCSI: Only hard disks are supported. Don't assert, set a proper error instead.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/DrvSCSI.cpp

    r24124 r24241  
    964964    PDMBLOCKTYPE enmType = pThis->pDrvBlock->pfnGetType(pThis->pDrvBlock);
    965965    if (enmType != PDMBLOCKTYPE_HARD_DISK)
    966     {
    967         AssertMsgFailed(("Configuration error: Not a disk or cd/dvd-rom. enmType=%d\n", enmType));
    968         return VERR_PDM_UNSUPPORTED_BLOCK_TYPE;
    969     }
     966        return PDMDrvHlpVMSetError(pDrvIns, VERR_PDM_UNSUPPORTED_BLOCK_TYPE, RT_SRC_POS,
     967                                   N_("Only hard disks are currently supported as SCSI devices (enmType=%d)"),
     968                                   enmType);
    970969    pThis->enmType = enmType;
    971970    pThis->cSectors = pThis->pDrvBlock->pfnGetSize(pThis->pDrvBlock) / 512;
     
    976975
    977976    /* Register statistics counter. */
    978     /** @odo r=aeichner: Find a way to put the instance number of the attached controller device
    979      * when we support more than one controller of the same type. At the moment we have the
    980      * 0 hardcoded. */
     977    /** @todo aeichner: Find a way to put the instance number of the attached
     978     * controller device when we support more than one controller of the same type.
     979     * At the moment we have the 0 hardcoded. */
    981980    PDMDrvHlpSTAMRegisterF(pDrvIns, &pThis->StatBytesRead, STAMTYPE_COUNTER, STAMVISIBILITY_ALWAYS, STAMUNIT_BYTES,
    982981                            "Amount of data read.", "/Devices/SCSI0/%d/ReadBytes", pDrvIns->iInstance);
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