Changeset 91703 in vbox for trunk/src/VBox/Devices/Storage
- Timestamp:
- Oct 13, 2021 2:24:30 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevVirtioSCSI.cpp
r90791 r91703 358 358 { 359 359 R3PTRTYPE(PPDMTHREAD) pThread; /**< pointer to worker thread's handle */ 360 uint16_t auRedoDescs[VIRTQ_ MAX_ENTRIES];/**< List of previously suspended reqs to re-submit */360 uint16_t auRedoDescs[VIRTQ_SIZE];/**< List of previously suspended reqs to re-submit */ 361 361 uint16_t cRedoDescs; /**< Number of redo desc chain head desc idxes in list */ 362 362 } VIRTIOSCSIWORKERR3; … … 457 457 uint32_t fHasT10pi; 458 458 459 /** True if VIRTIO_SCSI_F_ T10_PIwas negotiated */459 /** True if VIRTIO_SCSI_F_HOTPLUG was negotiated */ 460 460 uint32_t fHasHotplug; 461 461 462 /** True if VIRTIO_SCSI_F_ T10_PIwas negotiated */462 /** True if VIRTIO_SCSI_F_INOUT was negotiated */ 463 463 uint32_t fHasInOutBufs; 464 464 465 /** True if VIRTIO_SCSI_F_ T10_PIwas negotiated */465 /** True if VIRTIO_SCSI_F_CHANGE was negotiated */ 466 466 uint32_t fHasLunChange; 467 467 … … 559 559 uint16_t uVirtqNbr; /**< Index of queue this request arrived on */ 560 560 PVIRTQBUF pVirtqBuf; /**< Prepared desc chain pulled from virtq avail ring */ 561 size_t cbDataIn; /**< size of data out buffer*/561 size_t cbDataIn; /**< size of datain buffer */ 562 562 size_t cbDataOut; /**< size of dataout buffer */ 563 563 uint16_t uDataInOff; /**< Fixed size of respHdr + sense (precede datain) */ 564 uint16_t uDataOutOff; /**< Fixed size of re spHdr + sense (precede datain)*/564 uint16_t uDataOutOff; /**< Fixed size of reqhdr + cdb (precede dataout) */ 565 565 uint32_t cbSenseAlloc; /**< Size of sense buffer */ 566 566 size_t cbSenseLen; /**< Receives \# bytes written into sense buffer */ … … 828 828 RTSGSEG aReqSegs[2]; 829 829 830 /* Segment #1: Re questheader*/830 /* Segment #1: Response header*/ 831 831 aReqSegs[0].pvSeg = pRespHdr; 832 832 aReqSegs[0].cbSeg = sizeof(*pRespHdr); … … 1164 1164 */ 1165 1165 size_t const cbReqHdr = sizeof(REQ_CMD_HDR_T) + cbCdb; 1166 AssertReturn(pVirtqBuf ->cbPhysSend >= cbReqHdr, VERR_INVALID_PARAMETER);1166 AssertReturn(pVirtqBuf && pVirtqBuf->cbPhysSend >= cbReqHdr, VERR_INVALID_PARAMETER); 1167 1167 1168 1168 AssertCompile(VIRTIOSCSI_CDB_SIZE_MAX < 4096); … … 1714 1714 /* 1715 1715 * BIOS may change these values. When the OS comes up, and KVM driver accessed 1716 * through the Windows,assumes they are the default size. So as per the VirtIO 1.0 spec,1716 * through Windows, it assumes they are the default size. So as per the VirtIO 1.0 spec, 1717 1717 * 5.6.4, these device configuration values must be set to default upon device reset. 1718 1718 */ … … 1958 1958 rc = pHlp->pfnSSMGetU16(pSSM, &cReqsRedo); 1959 1959 AssertRCReturn(rc, rc); 1960 AssertReturn(cReqsRedo < VIRTQ_ MAX_ENTRIES,1960 AssertReturn(cReqsRedo < VIRTQ_SIZE, 1961 1961 pHlp->pfnSSMSetLoadError(pSSM, VERR_SSM_DATA_UNIT_FORMAT_CHANGED, RT_SRC_POS, 1962 1962 N_("Bad count of I/O transactions to re-do in saved state (%#x, max %#x - 1)"), 1963 cReqsRedo, VIRTQ_ MAX_ENTRIES));1963 cReqsRedo, VIRTQ_SIZE)); 1964 1964 1965 1965 for (uint16_t uVirtqNbr = VIRTQ_REQ_BASE; uVirtqNbr < VIRTIOSCSI_VIRTQ_CNT; uVirtqNbr++) … … 1982 1982 rc = pHlp->pfnSSMGetU16(pSSM, &idxHead); 1983 1983 AssertRCReturn(rc, rc); 1984 AssertReturn(idxHead < VIRTQ_ MAX_ENTRIES,1984 AssertReturn(idxHead < VIRTQ_SIZE, 1985 1985 pHlp->pfnSSMSetLoadError(pSSM, VERR_SSM_DATA_UNIT_FORMAT_CHANGED, RT_SRC_POS, 1986 1986 N_("Bad queue element index for re-do in saved state (%#x, max %#x)"), 1987 idxHead, VIRTQ_ MAX_ENTRIES- 1));1987 idxHead, VIRTQ_SIZE - 1)); 1988 1988 1989 1989 PVIRTIOSCSIWORKERR3 pWorkerR3 = &pThisCC->aWorkers[uVirtqNbr]; 1990 1990 pWorkerR3->auRedoDescs[pWorkerR3->cRedoDescs++] = idxHead; 1991 pWorkerR3->cRedoDescs %= VIRTQ_ MAX_ENTRIES;1991 pWorkerR3->cRedoDescs %= VIRTQ_SIZE; 1992 1992 } 1993 1993 }
Note:
See TracChangeset
for help on using the changeset viewer.