VirtualBox

Changeset 63991 in vbox for trunk


Ignore:
Timestamp:
Sep 25, 2016 5:30:01 PM (8 years ago)
Author:
vboxsync
Message:

PDMIMEDIAEX: Another addendum, make it possible to query a residual byte count which will be used for the SCSI layer later on

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmstorageifs.h

    r63955 r63991  
    786786
    787787    /**
     788     * Queries the residual amount of data not transfered when the request completed.
     789     *
     790     * @returns VBox status code.
     791     * @retval  VERR_PDM_MEDIAEX_IOREQ_INVALID_STATE has not completed yet.
     792     * @param   pInterface      Pointer to the interface structure containing the called function pointer.
     793     * @param   hIoReq          The I/O request.
     794     * @param   pcbResidual     Where to store the amount of resdiual data in bytes.
     795     * @thread  Any thread.
     796     */
     797    DECLR3CALLBACKMEMBER(int, pfnIoReqQueryResidual, (PPDMIMEDIAEX pInterface, PDMMEDIAEXIOREQ hIoReq, size_t *pcbResidual));
     798
     799    /**
    788800     * Cancels all I/O active requests.
    789801     *
     
    970982} PDMIMEDIAEX;
    971983/** PDMIMEDIAEX interface ID. */
    972 #define PDMIMEDIAEX_IID                      "ae47c9a9-fa43-4b07-8f9a-b45bcc3fb8e4"
     984#define PDMIMEDIAEX_IID                      "c36b27b0-6570-4e9c-b1ed-d6f4b87129a4"
    973985
    974986/**
  • trunk/src/VBox/Devices/Storage/DrvVD.cpp

    r63955 r63991  
    35223522
    35233523/**
     3524 * @interface_method_impl{PDMIMEDIAEX,pfnIoReqQueryResidual}
     3525 */
     3526static DECLCALLBACK(int) drvvdIoReqQueryResidual(PPDMIMEDIAEX pInterface, PDMMEDIAEXIOREQ hIoReq, size_t *pcbResidual)
     3527{
     3528    RT_NOREF1(pInterface);
     3529
     3530    PPDMMEDIAEXIOREQINT pIoReq = hIoReq;
     3531
     3532    if (pIoReq->enmState != VDIOREQSTATE_COMPLETED)
     3533        return VERR_PDM_MEDIAEX_IOREQ_INVALID_STATE;
     3534
     3535    if (   pIoReq->enmType != PDMMEDIAEXIOREQTYPE_READ
     3536        && pIoReq->enmType != PDMMEDIAEXIOREQTYPE_WRITE)
     3537        return VERR_PDM_MEDIAEX_IOREQ_INVALID_STATE;
     3538
     3539    *pcbResidual = 0; /* No data left to transfer always. */
     3540    return VINF_SUCCESS;
     3541}
     3542
     3543/**
    35243544 * @interface_method_impl{PDMIMEDIAEX,pfnIoReqCancelAll}
    35253545 */
     
    45014521    pThis->IMediaEx.pfnIoReqAlloc               = drvvdIoReqAlloc;
    45024522    pThis->IMediaEx.pfnIoReqFree                = drvvdIoReqFree;
     4523    pThis->IMediaEx.pfnIoReqQueryResidual       = drvvdIoReqQueryResidual;
    45034524    pThis->IMediaEx.pfnIoReqCancelAll           = drvvdIoReqCancelAll;
    45044525    pThis->IMediaEx.pfnIoReqCancel              = drvvdIoReqCancel;
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