Changeset 64407 in vbox for trunk/src/VBox
- Timestamp:
- Oct 25, 2016 11:53:00 AM (8 years ago)
- Location:
- trunk/src/VBox/Devices/Storage
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DrvHostBase.cpp
r64320 r64407 394 394 if (RT_LIKELY(pReq)) 395 395 { 396 pReq->cbReq = 0; 397 pReq->cbResidual = 0; 396 398 *phIoReq = (PDMMEDIAEXIOREQ)pReq; 397 399 *ppvIoReqAlloc = &pReq->abAlloc[0]; … … 416 418 static DECLCALLBACK(int) drvHostBaseIoReqQueryResidual(PPDMIMEDIAEX pInterface, PDMMEDIAEXIOREQ hIoReq, size_t *pcbResidual) 417 419 { 418 RT_NOREF2(pInterface, hIoReq); 419 420 *pcbResidual = 0; /** @todo: Implement. */ 420 RT_NOREF1(pInterface); 421 PDRVHOSTBASEREQ pReq = (PDRVHOSTBASEREQ)hIoReq; 422 423 *pcbResidual = pReq->cbResidual; 424 return VINF_SUCCESS; 425 } 426 427 /** @interface_method_impl{PDMIMEDIAEX,pfnIoReqQueryXferSize} */ 428 static DECLCALLBACK(int) drvHostBaseIoReqQueryXferSize(PPDMIMEDIAEX pInterface, PDMMEDIAEXIOREQ hIoReq, size_t *pcbXfer) 429 { 430 RT_NOREF1(pInterface); 431 PDRVHOSTBASEREQ pReq = (PDRVHOSTBASEREQ)hIoReq; 432 433 *pcbXfer = pReq->cbReq; 421 434 return VINF_SUCCESS; 422 435 } … … 444 457 pThis->pDrvIns->pReg->szName, pThis->pDrvIns->iInstance, off, cbRead, pThis->pszDevice)); 445 458 RTCritSectEnter(&pThis->CritSect); 459 460 pReq->cbReq = cbRead; 461 pReq->cbResidual = cbRead; 446 462 447 463 /* … … 464 480 "%16.*Rhxd\n", 465 481 pThis->pDrvIns->pReg->szName, pThis->pDrvIns->iInstance, off, cbRead, cbRead, pvBuf)); 482 483 pReq->cbResidual = 0; 466 484 } 467 485 else … … 493 511 pThis->pDrvIns->pReg->szName, pThis->pDrvIns->iInstance, off, cbWrite, pThis->pszDevice)); 494 512 RTCritSectEnter(&pThis->CritSect); 513 514 pReq->cbReq = cbWrite; 515 pReq->cbResidual = cbWrite; 495 516 496 517 /* … … 517 538 pThis->pDrvIns->pReg->szName, pThis->pDrvIns->iInstance, 518 539 off, pvBuf, cbWrite, rc, pThis->pszDevice)); 540 else 541 pReq->cbResidual = 0; 519 542 520 543 rc = drvHostBaseBufferRelease(pThis, pReq, cbWrite, true, pvBuf); … … 1052 1075 pThis->IMediaEx.pfnIoReqFree = drvHostBaseIoReqFree; 1053 1076 pThis->IMediaEx.pfnIoReqQueryResidual = drvHostBaseIoReqQueryResidual; 1077 pThis->IMediaEx.pfnIoReqQueryXferSize = drvHostBaseIoReqQueryXferSize; 1054 1078 pThis->IMediaEx.pfnIoReqCancelAll = drvHostBaseIoReqCancelAll; 1055 1079 pThis->IMediaEx.pfnIoReqCancel = drvHostBaseIoReqCancel; -
trunk/src/VBox/Devices/Storage/DrvHostBase.h
r64320 r64407 133 133 typedef struct DRVHOSTBASEREQ 134 134 { 135 /** Transfer size. */ 136 size_t cbReq; 137 /** Amount of residual data. */ 138 size_t cbResidual; 135 139 /** Start of the request data for the device above us. */ 136 140 uint8_t abAlloc[1]; -
trunk/src/VBox/Devices/Storage/DrvHostDVD.cpp
r64362 r64407 565 565 void *pvBuf = NULL; 566 566 size_t cbXferCur = cbXfer; 567 568 pReq->cbReq = cbXfer; 569 pReq->cbResidual = cbXfer; 567 570 568 571 if (cbXfer) … … 645 648 if (rc != VINF_SUCCESS) 646 649 break; 650 651 pReq->cbResidual -= cbCurrTX; 647 652 iATAPILBA += cReqSectors; 648 653 pbBuf += cbSector * cReqSectors; … … 654 659 rc = drvHostBaseScsiCmdOs(&pThis->Core, pbCdb, cbCdb, enmXferDir, pvBuf, &cbXferTmp, 655 660 &pThis->abATAPISense[0], sizeof(pThis->abATAPISense), cTimeoutMillies); 661 if (RT_SUCCESS(rc)) 662 pReq->cbResidual -= cbXferTmp; 656 663 } 657 664 -
trunk/src/VBox/Devices/Storage/DrvSCSI.cpp
r64226 r64407 789 789 } 790 790 791 /** @interface_method_impl{PDMIMEDIAEX,pfnIoReqQueryXferSize} */ 792 static DECLCALLBACK(int) drvscsiIoReqQueryXferSize(PPDMIMEDIAEX pInterface, PDMMEDIAEXIOREQ hIoReq, size_t *pcbXfer) 793 { 794 RT_NOREF1(pInterface); 795 PDRVSCSIREQ pReq = (PDRVSCSIREQ)hIoReq; 796 797 *pcbXfer = pReq->cbBuf; /** @todo: Implement properly. */ 798 return VINF_SUCCESS; 799 } 800 791 801 /** @interface_method_impl{PDMIMEDIAEX,pfnIoReqCancelAll} */ 792 802 static DECLCALLBACK(int) drvscsiIoReqCancelAll(PPDMIMEDIAEX pInterface) … … 1288 1298 pThis->IMediaEx.pfnIoReqFree = drvscsiIoReqFree; 1289 1299 pThis->IMediaEx.pfnIoReqQueryResidual = drvscsiIoReqQueryResidual; 1300 pThis->IMediaEx.pfnIoReqQueryXferSize = drvscsiIoReqQueryXferSize; 1290 1301 pThis->IMediaEx.pfnIoReqCancelAll = drvscsiIoReqCancelAll; 1291 1302 pThis->IMediaEx.pfnIoReqCancel = drvscsiIoReqCancel; -
trunk/src/VBox/Devices/Storage/DrvVD.cpp
r64274 r64407 3402 3402 3403 3403 if ( pIoReq->enmType != PDMMEDIAEXIOREQTYPE_READ 3404 && pIoReq->enmType != PDMMEDIAEXIOREQTYPE_WRITE) 3404 && pIoReq->enmType != PDMMEDIAEXIOREQTYPE_WRITE 3405 && pIoReq->enmType != PDMMEDIAEXIOREQTYPE_FLUSH) 3405 3406 return VERR_PDM_MEDIAEX_IOREQ_INVALID_STATE; 3406 3407 3407 3408 *pcbResidual = 0; /* No data left to transfer always. */ 3408 3409 return VINF_SUCCESS; 3410 } 3411 3412 /** 3413 * @interface_method_impl{PDMIMEDIAEX,pfnIoReqQueryXferSize} 3414 */ 3415 static DECLCALLBACK(int) drvvdIoReqQueryXferSize(PPDMIMEDIAEX pInterface, PDMMEDIAEXIOREQ hIoReq, size_t *pcbXfer) 3416 { 3417 int rc = VINF_SUCCESS; 3418 RT_NOREF1(pInterface); 3419 3420 PPDMMEDIAEXIOREQINT pIoReq = hIoReq; 3421 3422 if (pIoReq->enmState != VDIOREQSTATE_COMPLETED) 3423 return VERR_PDM_MEDIAEX_IOREQ_INVALID_STATE; 3424 3425 if ( pIoReq->enmType == PDMMEDIAEXIOREQTYPE_READ 3426 || pIoReq->enmType == PDMMEDIAEXIOREQTYPE_WRITE) 3427 *pcbXfer = pIoReq->ReadWrite.cbReq; 3428 else if (pIoReq->enmType == PDMMEDIAEXIOREQTYPE_FLUSH) 3429 *pcbXfer = 0; 3430 else 3431 rc = VERR_PDM_MEDIAEX_IOREQ_INVALID_STATE; 3432 3433 return rc; 3409 3434 } 3410 3435 … … 4389 4414 pThis->IMediaEx.pfnIoReqFree = drvvdIoReqFree; 4390 4415 pThis->IMediaEx.pfnIoReqQueryResidual = drvvdIoReqQueryResidual; 4416 pThis->IMediaEx.pfnIoReqQueryXferSize = drvvdIoReqQueryXferSize; 4391 4417 pThis->IMediaEx.pfnIoReqCancelAll = drvvdIoReqCancelAll; 4392 4418 pThis->IMediaEx.pfnIoReqCancel = drvvdIoReqCancel;
Note:
See TracChangeset
for help on using the changeset viewer.