Changeset 97402 in vbox for trunk/src/VBox/Devices/Storage/DevVirtioSCSI.cpp
- Timestamp:
- Nov 4, 2022 2:23:26 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevVirtioSCSI.cpp
r97400 r97402 847 847 * @param pDevIns The device instance. 848 848 * @param pThis VirtIO SCSI shared instance data. 849 * @param pThisCC VirtIO SCSI ring-3 instance data.850 849 * @param uVirtqNbr Virtq index 851 850 * @param pVirtqBuf Pointer to pre-processed descriptor chain pulled from virtq … … 856 855 * @returns VINF_SUCCESS 857 856 */ 858 static int virtioScsiR3ReqErr(PPDMDEVINS pDevIns, PVIRTIOSCSI pThis, PVIRTIOSCSICC pThisCC,uint16_t uVirtqNbr,857 static int virtioScsiR3ReqErr(PPDMDEVINS pDevIns, PVIRTIOSCSI pThis, uint16_t uVirtqNbr, 859 858 PVIRTQBUF pVirtqBuf, REQ_RESP_HDR_T *pRespHdr, uint8_t *pbSense, 860 859 size_t cbSenseCfg) … … 905 904 * @param pDevIns The device instance. 906 905 * @param pThis VirtIO SCSI shared instance data. 907 * @param pThisCC VirtIO SCSI ring-3 instance data.908 906 * @param uVirtqNbr Virtq index 909 907 * @param pVirtqBuf Pointer to pre-processed descriptor chain pulled from virtq … … 917 915 * @returns VINF_SUCCESS 918 916 */ 919 static int virtioScsiR3ReqErr4(PPDMDEVINS pDevIns, PVIRTIOSCSI pThis, PVIRTIOSCSICC pThisCC,uint16_t uVirtqNbr,917 static int virtioScsiR3ReqErr4(PPDMDEVINS pDevIns, PVIRTIOSCSI pThis, uint16_t uVirtqNbr, 920 918 PVIRTQBUF pVirtqBuf, size_t cbResidual, uint8_t bStatus, uint8_t bResponse, 921 919 uint8_t *pbSense, size_t cbSense, size_t cbSenseCfg) … … 928 926 RespHdr.uResponse = bResponse; 929 927 930 return virtioScsiR3ReqErr(pDevIns, pThis, pThisCC,uVirtqNbr, pVirtqBuf, &RespHdr, pbSense, cbSenseCfg);928 return virtioScsiR3ReqErr(pDevIns, pThis, uVirtqNbr, pVirtqBuf, &RespHdr, pbSense, cbSenseCfg); 931 929 } 932 930 … … 1050 1048 respHdr.uResidual = pReq->cbDataIn & UINT32_MAX; 1051 1049 1052 virtioScsiR3ReqErr(pDevIns, pThis, p ThisCC, pReq->uVirtqNbr, pReq->pVirtqBuf, &respHdr, abSense,1050 virtioScsiR3ReqErr(pDevIns, pThis, pReq->uVirtqNbr, pReq->pVirtqBuf, &respHdr, abSense, 1053 1051 RT_MIN(pThis->virtioScsiConfig.uSenseSize, VIRTIOSCSI_SENSE_SIZE_MAX)); 1054 1052 } … … 1260 1258 { 1261 1259 Log2Func(("Error submitting request, bad LUN format\n")); 1262 return virtioScsiR3ReqErr4(pDevIns, pThis, pThisCC,uVirtqNbr, pVirtqBuf, cbDataIn + cbDataOut, 0 /*bStatus*/,1260 return virtioScsiR3ReqErr4(pDevIns, pThis, uVirtqNbr, pVirtqBuf, cbDataIn + cbDataOut, 0 /*bStatus*/, 1263 1261 VIRTIOSCSI_S_FAILURE, NULL /*pbSense*/, 0 /*cbSense*/, cbSenseCfg); 1264 1262 } … … 1275 1273 0, SCSI_SENSE_ILLEGAL_REQUEST, 1276 1274 0, 0, 0, 0, 10, SCSI_ASC_LOGICAL_UNIT_NOT_SUPPORTED, 0, 0 }; 1277 return virtioScsiR3ReqErr4(pDevIns, pThis, pThisCC,uVirtqNbr, pVirtqBuf, cbDataIn + cbDataOut, SCSI_STATUS_CHECK_CONDITION,1275 return virtioScsiR3ReqErr4(pDevIns, pThis, uVirtqNbr, pVirtqBuf, cbDataIn + cbDataOut, SCSI_STATUS_CHECK_CONDITION, 1278 1276 VIRTIOSCSI_S_BAD_TARGET, abSense, sizeof(abSense), cbSenseCfg); 1279 1277 } … … 1286 1284 0, SCSI_SENSE_ILLEGAL_REQUEST, 1287 1285 0, 0, 0, 0, 10, SCSI_ASC_LOGICAL_UNIT_NOT_SUPPORTED, 0, 0 }; 1288 return virtioScsiR3ReqErr4(pDevIns, pThis, pThisCC,uVirtqNbr, pVirtqBuf, cbDataIn + cbDataOut, SCSI_STATUS_CHECK_CONDITION,1286 return virtioScsiR3ReqErr4(pDevIns, pThis, uVirtqNbr, pVirtqBuf, cbDataIn + cbDataOut, SCSI_STATUS_CHECK_CONDITION, 1289 1287 VIRTIOSCSI_S_OK, abSense, sizeof(abSense), cbSenseCfg); 1290 1288 } … … 1294 1292 { 1295 1293 Log2Func(("Aborting req submission because reset is in progress\n")); 1296 return virtioScsiR3ReqErr4(pDevIns, pThis, pThisCC,uVirtqNbr, pVirtqBuf, cbDataIn + cbDataOut, SCSI_STATUS_OK,1294 return virtioScsiR3ReqErr4(pDevIns, pThis, uVirtqNbr, pVirtqBuf, cbDataIn + cbDataOut, SCSI_STATUS_OK, 1297 1295 VIRTIOSCSI_S_RESET, NULL /*pbSense*/, 0 /*cbSense*/, cbSenseCfg); 1298 1296 } … … 1306 1304 uint8_t abSense[] = { RT_BIT(7) | SCSI_SENSE_RESPONSE_CODE_CURR_FIXED, 1307 1305 0, SCSI_SENSE_ILLEGAL_REQUEST, 0, 0, 0, 0, 10, 0, 0, 0 }; 1308 return virtioScsiR3ReqErr4(pDevIns, pThis, pThisCC,uVirtqNbr, pVirtqBuf, cbDataIn + cbDataOut, SCSI_STATUS_CHECK_CONDITION,1306 return virtioScsiR3ReqErr4(pDevIns, pThis, uVirtqNbr, pVirtqBuf, cbDataIn + cbDataOut, SCSI_STATUS_CHECK_CONDITION, 1309 1307 VIRTIOSCSI_S_FAILURE, abSense, sizeof(abSense), cbSenseCfg); 1310 1308 } … … 1377 1375 respHdr.uResponse = VIRTIOSCSI_S_FAILURE; 1378 1376 respHdr.uResidual = (cbDataIn + cbDataOut) & UINT32_MAX; 1379 virtioScsiR3ReqErr(pDevIns, pThis, pThisCC,uVirtqNbr, pVirtqBuf, &respHdr, abSense, cbSenseCfg);1377 virtioScsiR3ReqErr(pDevIns, pThis, uVirtqNbr, pVirtqBuf, &respHdr, abSense, cbSenseCfg); 1380 1378 virtioScsiR3FreeReq(pTarget, pReq); 1381 1379 virtioScsiR3Release(pDevIns, pThis, pThisCC);
Note:
See TracChangeset
for help on using the changeset viewer.