VirtualBox

Changeset 28784 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 26, 2010 11:59:42 PM (15 years ago)
Author:
vboxsync
Message:

Interface changes for error reporting and async I/O

Location:
trunk/src/VBox/Devices/Storage
Files:
6 edited

Legend:

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

    r28705 r28784  
    49204920 * @param   pInterface   Pointer to the interface.
    49214921 * @param   pvUser       User data.
    4922  */
    4923 static DECLCALLBACK(int) ahciTransferCompleteNotify(PPDMIBLOCKASYNCPORT pInterface, void *pvUser)
     4922 * @param   rcReq        IPRT Status code of the completed request.
     4923 */
     4924static DECLCALLBACK(int) ahciTransferCompleteNotify(PPDMIBLOCKASYNCPORT pInterface, void *pvUser, int rcReq)
    49244925{
    49254926    PAHCIPort pAhciPort = PDMIBLOCKASYNCPORT_2_PAHCIPORT(pInterface);
  • trunk/src/VBox/Devices/Storage/DrvBlock.cpp

    r28387 r28784  
    356356#define PDMIMEDIAASYNCPORT_2_DRVBLOCK(pInterface)    ( (PDRVBLOCK((uintptr_t)pInterface - RT_OFFSETOF(DRVBLOCK, IMediaAsyncPort))) )
    357357
    358 static DECLCALLBACK(int) drvblockAsyncTransferCompleteNotify(PPDMIMEDIAASYNCPORT pInterface, void *pvUser)
     358static DECLCALLBACK(int) drvblockAsyncTransferCompleteNotify(PPDMIMEDIAASYNCPORT pInterface, void *pvUser, int rcReq)
    359359{
    360360    PDRVBLOCK pThis = PDMIMEDIAASYNCPORT_2_DRVBLOCK(pInterface);
    361361
    362     return pThis->pDrvBlockAsyncPort->pfnTransferCompleteNotify(pThis->pDrvBlockAsyncPort, pvUser);
     362    return pThis->pDrvBlockAsyncPort->pfnTransferCompleteNotify(pThis->pDrvBlockAsyncPort, pvUser, rcReq);
    363363}
    364364
  • trunk/src/VBox/Devices/Storage/DrvDiskIntegrity.cpp

    r28144 r28784  
    519519#define PDMIMEDIAASYNCPORT_2_DRVDISKINTEGRITY(pInterface)    ( (PDRVDISKINTEGRITY((uintptr_t)pInterface - RT_OFFSETOF(DRVDISKINTEGRITY, IMediaAsyncPort))) )
    520520
    521 static DECLCALLBACK(int) drvdiskintAsyncTransferCompleteNotify(PPDMIMEDIAASYNCPORT pInterface, void *pvUser)
     521static DECLCALLBACK(int) drvdiskintAsyncTransferCompleteNotify(PPDMIMEDIAASYNCPORT pInterface, void *pvUser, int rcReq)
    522522{
    523523    PDRVDISKINTEGRITY pThis = PDMIMEDIAASYNCPORT_2_DRVDISKINTEGRITY(pInterface);
     
    527527    LogFlowFunc(("pIoReq=%#p\n", pIoReq));
    528528
    529     if (pIoReq->fRead)
    530         rc = drvdiskintReadVerify(pThis, pIoReq->paSeg, pIoReq->cSeg, pIoReq->off, pIoReq->cbTransfer);
    531     else
    532         rc = drvdiskintWriteRecord(pThis, pIoReq->paSeg, pIoReq->cSeg, pIoReq->off, pIoReq->cbTransfer);
    533 
    534     AssertRC(rc);
    535 
    536     rc = pThis->pDrvMediaAsyncPort->pfnTransferCompleteNotify(pThis->pDrvMediaAsyncPort, pIoReq->pvUser);
     529    if (RT_SUCCESS(rcReq))
     530    {
     531        if (pIoReq->fRead)
     532            rc = drvdiskintReadVerify(pThis, pIoReq->paSeg, pIoReq->cSeg, pIoReq->off, pIoReq->cbTransfer);
     533        else
     534            rc = drvdiskintWriteRecord(pThis, pIoReq->paSeg, pIoReq->cSeg, pIoReq->off, pIoReq->cbTransfer);
     535
     536        AssertRC(rc);
     537    }
     538
     539    rc = pThis->pDrvMediaAsyncPort->pfnTransferCompleteNotify(pThis->pDrvMediaAsyncPort, pIoReq->pvUser, rcReq);
    537540    RTMemFree(pIoReq);
    538541
  • trunk/src/VBox/Devices/Storage/DrvSCSI.cpp

    r28383 r28784  
    191191}
    192192
    193 static int drvscsiTransferCompleteNotify(PPDMIBLOCKASYNCPORT pInterface, void *pvUser)
     193static int drvscsiTransferCompleteNotify(PPDMIBLOCKASYNCPORT pInterface, void *pvUser, int rc)
    194194{
    195195    PDRVSCSI pThis = PDMIBLOCKASYNCPORT_2_DRVSCSI(pInterface);
     
    207207
    208208    ASMAtomicDecU32(&pThis->StatIoDepth);
    209     VSCSIIoReqCompleted(hVScsiIoReq, VINF_SUCCESS);
     209    VSCSIIoReqCompleted(hVScsiIoReq, rc);
    210210
    211211    return VINF_SUCCESS;
  • trunk/src/VBox/Devices/Storage/DrvVD.cpp

    r28622 r28784  
    304304
    305305        AssertPtr(pStorageBackend->pfnCompleted);
    306         rc = pStorageBackend->pfnCompleted(pvUser);
     306        rc = pStorageBackend->pfnCompleted(pvUser, rcReq);
    307307        AssertRC(rc);
    308308
     
    991991*******************************************************************************/
    992992
    993 static void drvvdAsyncReqComplete(void *pvUser1, void *pvUser2)
     993static void drvvdAsyncReqComplete(void *pvUser1, void *pvUser2, int rcReq)
    994994{
    995995    PVBOXDISK pThis = (PVBOXDISK)pvUser1;
    996996
    997997    int rc = pThis->pDrvMediaAsyncPort->pfnTransferCompleteNotify(pThis->pDrvMediaAsyncPort,
    998                                                                   pvUser2);
     998                                                                  pvUser2, rcReq);
    999999    AssertRC(rc);
    10001000}
  • trunk/src/VBox/Devices/Storage/VBoxHDD.cpp

    r28704 r28784  
    17591759}
    17601760
    1761 static int vdIOReqCompleted(void *pvUser)
     1761static int vdIOReqCompleted(void *pvUser, int rcReq)
    17621762{
    17631763    int rc = VINF_SUCCESS;
     
    18161816                {
    18171817                    LogFlowFunc(("Parent I/O context completed pIoCtxParent=%#p\n", pIoCtx));
    1818                     pIoCtxParent->Type.Root.pfnComplete(pIoCtxParent->Type.Root.pvUser1, pIoCtxParent->Type.Root.pvUser2);
     1818                    pIoCtxParent->Type.Root.pfnComplete(pIoCtxParent->Type.Root.pvUser1,
     1819                                                        pIoCtxParent->Type.Root.pvUser2,
     1820                                                        pIoCtxParent->rcReq);
    18191821                    vdIoCtxFree(pDisk, pIoCtxParent);
    18201822                }
     
    18571859                            LogFlowFunc(("Waiting I/O context completed pIoCtxWait=%#p\n", pIoCtxWait));
    18581860                            pIoCtxWait->Type.Root.pfnComplete(pIoCtxWait->Type.Root.pvUser1,
    1859                                                               pIoCtxWait->Type.Root.pvUser2);
     1861                                                              pIoCtxWait->Type.Root.pvUser2,
     1862                                                              pIoCtxWait->rcReq);
    18601863                            vdIoCtxFree(pDisk, pIoCtxWait);
    18611864                        }
     
    18661869            }
    18671870            else
    1868                 pIoCtx->Type.Root.pfnComplete(pIoCtx->Type.Root.pvUser1, pIoCtx->Type.Root.pvUser2);
     1871                pIoCtx->Type.Root.pfnComplete(pIoCtx->Type.Root.pvUser1,
     1872                                              pIoCtx->Type.Root.pvUser2,
     1873                                              pIoCtx->rcReq);
    18691874
    18701875            vdIoCtxFree(pDisk, pIoCtx);
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