Changeset 80148 in vbox for trunk/src/VBox/Devices/Storage
- Timestamp:
- Aug 6, 2019 6:36:58 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 132589
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevVirtioSCSI.cpp
r80108 r80148 67 67 */ 68 68 69 #define MATCH_SCSI_CONFIG(member) \ 70 ((int)uOffset >= RT_OFFSETOF(VIRTIO_SCSI_CONFIG_T, member) \ 71 && uOffset < (uint32_t)(RT_OFFSETOF(VIRTIO_SCSI_CONFIG_T, member) \ 72 + RT_SIZEOFMEMB(VIRTIO_SCSI_CONFIG_T, member)) \ 73 && cb <= RT_SIZEOFMEMB(VIRTIO_SCSI_CONFIG_T, member) \ 74 - (uOffset - RT_OFFSETOF(VIRTIO_SCSI_CONFIG_T, member))) 75 76 #define LOG_ACCESSOR(member) \ 77 LogFunc(("Guest %s %s [%d:%d]: %.*Rhxs\n", \ 78 fWrite ? "wrote" : "read ", #member, mOffset, mOffset + cb, cb, pv)); 79 80 #define SCSI_CONFIG_ACCESSOR(member) \ 81 { \ 82 uint32_t mOffset = uOffset - RT_OFFSETOF(VIRTIO_SCSI_CONFIG_T, member); \ 83 if (fWrite) \ 84 memcpy(((char *)&pThis->virtioScsiConfig.member) + uOffset, (const char *)pv, cb); \ 85 else \ 86 memcpy((char *)pv, (const char *)(((char *)&pThis->virtioScsiConfig.member) + uOffset), cb); \ 87 LOG_ACCESSOR(member); \ 88 } 89 90 #define SCSI_CONFIG_ACCESSOR_READONLY(member) \ 91 { \ 92 uint32_t mOffset = uOffset - RT_OFFSETOF(VIRTIO_SCSI_CONFIG_T, member); \ 93 if (fWrite) \ 94 LogFunc(("Guest attempted to write readonly virtio_pci_common_cfg.%s\n", #member)); \ 95 else \ 96 { \ 97 memcpy((char *)pv, (const char *)(((char *)&pThis->virtioScsiConfig.member) + uOffset), cb); \ 98 LOG_ACCESSOR(member); \ 99 } \ 100 } 101 102 69 103 /** @name VirtIO 1.0 SCSI Host feature bits 70 104 * @{ */ … … 83 117 | VIRTIOSCSI_F_T10_PI \ 84 118 85 typedef struct VIRTIO_PCI_DEV_CAP_T 86 { 87 uint32_t uTestField1; 88 uint32_t uTestField2; 89 } VIRTIO_PCI_DEV_CAP_T, *PVIRTIO_PCI_DEV_CAP_T; 119 typedef struct virtio_scsi_config 120 { 121 uint32_t uNumQueues; /** num_queues */ 122 uint32_t uSegMax; /** seg_max */ 123 uint32_t uMaxSectors; /** max_sectors */ 124 uint32_t uCmdPerLun; /** cmd_per_lun */ 125 uint32_t uEventInfoSize; /** event_info_size */ 126 uint32_t uSenseSize; /** sense_size */ 127 uint32_t uCdbSize; /** cdb_size */ 128 uint16_t uMaxChannel; /** max_channel */ 129 uint16_t uMaxTarget; /** max_target */ 130 uint32_t uMaxLun; /** max_lun */ 131 } VIRTIO_SCSI_CONFIG_T, PVIRTIO_SCSI_CONFIG_T; 132 133 #define CDB_SIZE 1 /* logic tbd */ 134 #define SENSE_SIZE 1 /* logic tbd */ 135 #define PI_BYTES_OUT 1 /* logic tbd */ 136 #define PI_BYTES_IN 1 /* logic tbd */ 137 #define DATA_OUT 1 /* logic tbd */ 138 typedef struct virtio_scsi_req_cmd 139 { 140 /* Device-readable part */ 141 uint8_t uLUN[8]; /** lun */ 142 uint64_t uId; /** id */ 143 uint8_t uTaskAttr; /** task_attr */ 144 uint8_t uPrio; /** prio */ 145 uint8_t uCrn; /** crn */ 146 uint8_t uCdb[CDB_SIZE]; /** cdb */ 147 148 /** Following three fields only present if VIRTIOSCSI_F_T10_PI negotiated */ 149 150 uint32_t uPiBytesOut; /** pi_bytesout */ 151 uint32_t uPiBytesIn; /** pi_bytesin */ 152 uint8_t uPiOut[PI_BYTES_OUT]; /** pi_out[] */ 153 154 uint8_t uDataOut[DATA_OUT]; /** dataout */ 155 156 /* Device-writable part */ 157 uint32_t uSenseLen; /** sense_len */ 158 uint32_t uResidual; /** residual */ 159 uint16_t uStatusQualifier; /** status_qualifier */ 160 uint8_t uStatus; /** status */ 161 uint8_t uResponse; /** response */ 162 uint8_t uSense[SENSE_SIZE]; /** sense */ 163 164 /** Following two fields only present if VIRTIOSCSI_F_T10_PI negotiated */ 165 uint8_t uPiIn[PI_BYTES_IN]; /** pi_in[] */ 166 uint8_t uDataIn[]; /** detain; */ 167 } VIRTIO_SCSI_REQ_CMD_T, *PVIRTIO_SCSI_REQ_CMD_T; 168 169 /** Command-specific response values */ 170 #define VIRTIOSCSI_S_OK 0 /* control, command */ 171 #define VIRTIOSCSI_S_OVERRUN 1 /* control */ 172 #define VIRTIOSCSI_S_ABORTED 2 /* control */ 173 #define VIRTIOSCSI_S_BAD_TARGET 3 /* control, command */ 174 #define VIRTIOSCSI_S_RESET 4 /* control */ 175 #define VIRTIOSCSI_S_BUSY 5 /* control, command */ 176 #define VIRTIOSCSI_S_TRANSPORT_FAILURE 6 /* control, command */ 177 #define VIRTIOSCSI_S_TARGET_FAILURE 7 /* control, command */ 178 #define VIRTIOSCSI_S_NEXUS_FAILURE 8 /* control, command */ 179 #define VIRTIOSCSI_S_FAILURE 9 /* control, command */ 180 #define VIRTIOSCSI_S_INCORRECT_LUN 12 /* command */ 181 182 183 /** task_attr */ 184 #define VIRTIOSCSI_S_SIMPLE 0 185 #define VIRTIOSCSI_S_ORDERED 1 186 #define VIRTIOSCSI_S_HEAD 2 187 #define VIRTIOSCSI_S_ACA 3 188 189 #define VIRTIOSCSI_T_TMF 0 190 #define VIRTIOSCSI_T_TMF_ABORT_TASK 0 191 #define VIRTIOSCSI_T_TMF_ABORT_TASK_SET 1 192 #define VIRTIOSCSI_T_TMF_CLEAR_ACA 2 193 #define VIRTIOSCSI_T_TMF_CLEAR_TASK_SET 3 194 #define VIRTIOSCSI_T_TMF_I_T_NEXUS_RESET 4 195 #define VIRTIOSCSI_T_TMF_LOGICAL_UNIT_RESET 5 196 #define VIRTIOSCSI_T_TMF_QUERY_TASK 6 197 #define VIRTIOSCSI_T_TMF_QUERY_TASK_SET 7 198 199 typedef struct virtio_scsi_ctrl_tmf 200 { 201 // Device-readable part 202 uint32_t uType; /** type */ 203 uint32_t uSubtype; /** subtype */ 204 uint8_t uLUN[8]; /** lun */ 205 uint64_t uId; /** id */ 206 // Device-writable part 207 uint8_t uResponse; /** response */ 208 } VIRTIO_SCSI_CTRL_BUF_T, *PVIRTIO_SCSI_CTRL_BUF_T; 209 210 /* command-specific response values */ 211 212 #define VIRTIOSCSI_S_FUNCTION_COMPLETE 0 213 #define VIRTIOSCSI_S_FUNCTION_SUCCEEDED 10 214 #define VIRTIOSCSI_S_FUNCTION_REJECTED 11 215 216 #define VIRTIOSCSI_T_AN_QUERY 1 /** Asynchronous notification query */ 217 #define VIRTIOSCSI_T_AN_SUBSCRIBE 2 /** Asynchronous notification subscription */ 218 219 typedef struct virtio_scsi_ctrl_an 220 { 221 // Device-readable part 222 uint32_t uType; /** type */ 223 uint8_t uLUN[8]; /** lun */ 224 uint32_t uEventRequested; /** event_requested */ 225 // Device-writable part 226 uint32_t uEventActual; /** event_actual */ 227 uint8_t uResponse; /** response */ 228 } VIRTIO_SCSI_CTRL_AN, *PVIRTIO_SCSI_CTRL_AN_T; 229 230 #define VIRTIOSCSI_EVT_ASYNC_OPERATIONAL_CHANGE 2 231 #define VIRTIOSCSI_EVT_ASYNC_POWER_MGMT 4 232 #define VIRTIOSCSI_EVT_ASYNC_EXTERNAL_REQUEST 8 233 #define VIRTIOSCSI_EVT_ASYNC_MEDIA_CHANGE 16 234 #define VIRTIOSCSI_EVT_ASYNC_MULTI_HOST 32 235 #define VIRTIOSCSI_EVT_ASYNC_DEVICE_BUSY 64 236 237 /** Device operation: controlq */ 238 239 typedef struct virtio_scsi_ctrl 240 { 241 uint32_t type; /** type */ 242 uint8_t response; /** response */ 243 } VIRTIO_SCSI_CTRL_T, *PVIRTIO_SCSI_CTRL_T; 244 245 #define VIRTIOSCSI_T_NO_EVENT 0 246 247 #define VIRTIOSCSI_T_TRANSPORT_RESET 1 248 #define VIRTIOSCSI_T_ASYNC_NOTIFY 2 /** Asynchronous notification */ 249 #define VIRTIOSCSI_T_PARAM_CHANGE 3 250 251 #define VIRTIOSCSI_EVT_RESET_HARD 0 252 #define VIRTIOSCSI_EVT_RESET_RESCAN 1 253 #define VIRTIOSCSI_EVT_RESET_REMOVED 2 254 255 /** Device operation: eventq */ 256 257 #define VIRTIOSCSI_T_EVENTS_MISSED 0x80000000 258 typedef struct virtio_scsi_event { 259 // Device-writable part 260 uint32_t uEvent; /** event: */ 261 uint8_t uLUN[8]; /** lun */ 262 uint32_t uReason; /** reason */ 263 } VIRTIO_SCSI_EVENT_T, *PVIRTIO_SCSI_EVENT_T; 90 264 91 265 /** … … 149 323 /* virtioState must be first member */ 150 324 VIRTIOSTATE virtioState; 151 152 VIRTIO_PCI_DEV_CAP_T devSpecificCap;153 325 154 326 /* SCSI target instances data */ … … 194 366 /** True if PDMDevHlpAsyncNotificationCompleted should be called when port goes idle */ 195 367 bool volatile fSignalIdle; 368 369 VIRTIO_SCSI_CONFIG_T virtioScsiConfig; 196 370 197 371 } VIRTIOSCSI, *PVIRTIOSCSI; … … 221 395 } VIRTIOSCSIREQ; 222 396 typedef struct VIRTIOSCSIREQ *PVIRTIOSCSIREQ; 223 224 225 #define CDB_SIZE 1 /* logic tbd */226 #define SENSE_SIZE 1 /* logic tbd */227 #define PI_BYTES_OUT 1 /* logic tbd */228 #define PI_BYTES_IN 1 /* logic tbd */229 #define DATA_OUT 1 /* logic tbd */230 typedef struct virtio_scsi_req_cmd231 {232 /* Device-readable part */233 uint8_t uLUN[8]; /** lun */234 uint64_t uId; /** id */235 uint8_t uTaskAttr; /** task_attr */236 uint8_t uPrio; /** prio */237 uint8_t uCrn; /** crn */238 uint8_t uCdb[CDB_SIZE]; /** cdb */239 240 /** Following three fields only present if VIRTIOSCSI_F_T10_PI negotiated */241 242 uint32_t uPiBytesOut; /** pi_bytesout */243 uint32_t uPiBytesIn; /** pi_bytesin */244 uint8_t uPiOut[PI_BYTES_OUT]; /** pi_out[] */245 246 uint8_t uDataOut[DATA_OUT]; /** dataout */247 248 /* Device-writable part */249 uint32_t uSenseLen; /** sense_len */250 uint32_t uResidual; /** residual */251 uint16_t uStatusQualifier; /** status_qualifier */252 uint8_t uStatus; /** status */253 uint8_t uResponse; /** response */254 uint8_t uSense[SENSE_SIZE]; /** sense */255 256 /** Following two fields only present if VIRTIOSCSI_F_T10_PI negotiated */257 uint8_t uPiIn[PI_BYTES_IN]; /** pi_in[] */258 uint8_t uDataIn[]; /** detain; */259 } VIRTIOSCSIREQCMD, *PVIRTIOSCSIREQCMD;260 261 /** Command-specific response values */262 #define VIRTIOSCSI_S_OK 0 /* control, command */263 #define VIRTIOSCSI_S_OVERRUN 1 /* control */264 #define VIRTIOSCSI_S_ABORTED 2 /* control */265 #define VIRTIOSCSI_S_BAD_TARGET 3 /* control, command */266 #define VIRTIOSCSI_S_RESET 4 /* control */267 #define VIRTIOSCSI_S_BUSY 5 /* control, command */268 #define VIRTIOSCSI_S_TRANSPORT_FAILURE 6 /* control, command */269 #define VIRTIOSCSI_S_TARGET_FAILURE 7 /* control, command */270 #define VIRTIOSCSI_S_NEXUS_FAILURE 8 /* control, command */271 #define VIRTIOSCSI_S_FAILURE 9 /* control, command */272 #define VIRTIOSCSI_S_INCORRECT_LUN 12 /* command */273 274 275 /** task_attr */276 #define VIRTIOSCSI_S_SIMPLE 0277 #define VIRTIOSCSI_S_ORDERED 1278 #define VIRTIOSCSI_S_HEAD 2279 #define VIRTIOSCSI_S_ACA 3280 281 #define VIRTIOSCSI_T_TMF 0282 #define VIRTIOSCSI_T_TMF_ABORT_TASK 0283 #define VIRTIOSCSI_T_TMF_ABORT_TASK_SET 1284 #define VIRTIOSCSI_T_TMF_CLEAR_ACA 2285 #define VIRTIOSCSI_T_TMF_CLEAR_TASK_SET 3286 #define VIRTIOSCSI_T_TMF_I_T_NEXUS_RESET 4287 #define VIRTIOSCSI_T_TMF_LOGICAL_UNIT_RESET 5288 #define VIRTIOSCSI_T_TMF_QUERY_TASK 6289 #define VIRTIOSCSI_T_TMF_QUERY_TASK_SET 7290 291 typedef struct virtio_scsi_ctrl_tmf292 {293 // Device-readable part294 uint32_t uType; /** type */295 uint32_t uSubtype; /** subtype */296 uint8_t uLUN[8]; /** lun */297 uint64_t uId; /** id */298 // Device-writable part299 uint8_t uResponse; /** response */300 } VIRTIOSCSICTRLBUF, *PVIRTIOSCSICTRLBUF;301 302 /* command-specific response values */303 304 #define VIRTIOSCSI_S_FUNCTION_COMPLETE 0305 #define VIRTIOSCSI_S_FUNCTION_SUCCEEDED 10306 #define VIRTIOSCSI_S_FUNCTION_REJECTED 11307 308 #define VIRTIOSCSI_T_AN_QUERY 1 /** Asynchronous notification query */309 #define VIRTIOSCSI_T_AN_SUBSCRIBE 2 /** Asynchronous notification subscription */310 311 typedef struct virtio_scsi_ctrl_an312 {313 // Device-readable part314 uint32_t uType; /** type */315 uint8_t uLUN[8]; /** lun */316 uint32_t uEventRequested; /** event_requested */317 // Device-writable part318 uint32_t uEventActual; /** event_actual */319 uint8_t uResponse; /** response */320 } VIRTIOSCSICTRLAN, *PVIRTIOSCSICTRLAN;321 322 #define VIRTIOSCSI_EVT_ASYNC_OPERATIONAL_CHANGE 2323 #define VIRTIOSCSI_EVT_ASYNC_POWER_MGMT 4324 #define VIRTIOSCSI_EVT_ASYNC_EXTERNAL_REQUEST 8325 #define VIRTIOSCSI_EVT_ASYNC_MEDIA_CHANGE 16326 #define VIRTIOSCSI_EVT_ASYNC_MULTI_HOST 32327 #define VIRTIOSCSI_EVT_ASYNC_DEVICE_BUSY 64328 329 /** Device operation: controlq */330 331 typedef struct virtio_scsi_ctrl332 {333 uint32_t type; /** type */334 uint8_t response; /** response */335 } VIRTIOSCSICTRL, *PVIRTIOSCSICTRL;336 337 #define VIRTIOSCSI_T_NO_EVENT 0338 339 #define VIRTIOSCSI_T_TRANSPORT_RESET 1340 #define VIRTIOSCSI_T_ASYNC_NOTIFY 2 /** Asynchronous notification */341 #define VIRTIOSCSI_T_PARAM_CHANGE 3342 343 #define VIRTIOSCSI_EVT_RESET_HARD 0344 #define VIRTIOSCSI_EVT_RESET_RESCAN 1345 #define VIRTIOSCSI_EVT_RESET_REMOVED 2346 347 /** Device operation: eventq */348 349 #define VIRTIOSCSI_T_EVENTS_MISSED 0x80000000350 typedef struct virtio_scsi_event {351 // Device-writable part352 uint32_t uEvent; /** event: */353 uint8_t uLUN[8]; /** lun */354 uint32_t uReason; /** reason */355 } VIRTIOSCSIEVENT, *PVIRTIOSCSIEVENT;356 357 358 397 /*********************************************************************************************************************************/ 359 398 … … 719 758 } 720 759 760 static int virtioScsiR3ConfigAccess(PVIRTIOSCSI pThis, uint32_t uOffset, 761 const void *pv, size_t cb, uint8_t fWrite) 762 { 763 int rc = VINF_SUCCESS; 764 if (MATCH_SCSI_CONFIG(uNumQueues)) 765 { 766 SCSI_CONFIG_ACCESSOR_READONLY(uNumQueues); 767 } 768 else 769 if (MATCH_SCSI_CONFIG(uSegMax)) 770 { 771 SCSI_CONFIG_ACCESSOR_READONLY(uSegMax); 772 } 773 else 774 if (MATCH_SCSI_CONFIG(uMaxSectors)) 775 { 776 SCSI_CONFIG_ACCESSOR_READONLY(uMaxSectors); 777 } 778 else 779 if (MATCH_SCSI_CONFIG(uCmdPerLun)) 780 { 781 SCSI_CONFIG_ACCESSOR_READONLY(uCmdPerLun); 782 } 783 else 784 if (MATCH_SCSI_CONFIG(uEventInfoSize)) 785 { 786 SCSI_CONFIG_ACCESSOR_READONLY(uEventInfoSize); 787 } 788 else 789 if (MATCH_SCSI_CONFIG(uSenseSize)) 790 { 791 SCSI_CONFIG_ACCESSOR(uSenseSize); 792 } 793 else 794 if (MATCH_SCSI_CONFIG(uCdbSize)) 795 { 796 SCSI_CONFIG_ACCESSOR(uCdbSize); 797 } 798 else 799 if (MATCH_SCSI_CONFIG(uMaxChannel)) 800 { 801 SCSI_CONFIG_ACCESSOR_READONLY(uMaxChannel); 802 } 803 else 804 if (MATCH_SCSI_CONFIG(uMaxTarget)) 805 { 806 SCSI_CONFIG_ACCESSOR_READONLY(uMaxTarget); 807 } 808 else 809 if (MATCH_SCSI_CONFIG(uMaxLun)) 810 { 811 SCSI_CONFIG_ACCESSOR_READONLY(uMaxLun); 812 } 813 else 814 { 815 LogFunc(("Bad access by guest to virtio_scsi_config: uoff=%d, cb=%d\n", uOffset, cb)); 816 rc = VERR_ACCESS_DENIED; 817 } 818 return rc; 819 } 820 721 821 /** 722 822 * virtio-scsi VirtIO Device-specific capabilities read callback … … 724 824 * 725 825 * @param pDevIns The device instance. 726 * @param GCPhysAddr Guest driver physical address to read826 * @param uOffset Offset within device specific capabilities struct 727 827 * @param pvBuf Buffer in which to save read data 728 * @param cbRead Number of bytes to read 729 */ 730 static DECLCALLBACK(int) virtioScsiR3DevCapRead(PPDMDEVINS pDevIns, RTGCPHYS GCPhysAddr, const void *pvBuf, size_t cbRead) 731 { 732 /*TBD*/ 733 LogFunc(("Read from Device-Specific capabilities\n")); 734 RT_NOREF(pDevIns); 735 RT_NOREF(GCPhysAddr); 736 RT_NOREF(pvBuf); 737 RT_NOREF(cbRead); 738 int rv = VINF_SUCCESS; 739 return rv; 828 * @param cb Number of bytes to read 829 */ 830 static DECLCALLBACK(int) virtioScsiR3DevCapRead(PPDMDEVINS pDevIns, uint32_t uOffset, const void *pv, size_t cb) 831 { 832 int rc = VINF_SUCCESS; 833 PVIRTIOSCSI pThis = PDMINS_2_DATA(pDevIns, PVIRTIOSCSI); 834 835 // LogFunc(("Read from Device-Specific capabilities: uOffset: 0x%x, cb: 0x%x\n", 836 // uOffset, cb)); 837 838 rc = virtioScsiR3ConfigAccess(pThis, uOffset, pv, cb, false); 839 840 return rc; 740 841 } 741 842 … … 745 846 * 746 847 * @param pDevIns The device instance. 747 * @param GCPhysAddr Guest driver physical address to write848 * @param uOffset Offset within device specific capabilities struct 748 849 * @param pvBuf Buffer in which to save read data 749 * @param cbWrite Number of bytes to write 750 */ 751 static DECLCALLBACK(int) virtioScsiR3DevCapWrite(PPDMDEVINS pDevIns, RTGCPHYS GCPhysAddr, const void *pvBuf, size_t cbWrite) 752 { 753 /*TBD*/ 754 LogFunc(("Write to Device-Specific capabilities\n")); 755 RT_NOREF(pDevIns); 756 RT_NOREF(GCPhysAddr); 757 RT_NOREF(pvBuf); 758 RT_NOREF(cbWrite); 759 int rv = VINF_SUCCESS; 760 return rv; 850 * @param cb Number of bytes to write 851 */ 852 static DECLCALLBACK(int) virtioScsiR3DevCapWrite(PPDMDEVINS pDevIns, uint32_t uOffset, const void *pv, size_t cb) 853 { 854 int rc = VINF_SUCCESS; 855 PVIRTIOSCSI pThis = PDMINS_2_DATA(pDevIns, PVIRTIOSCSI); 856 857 // LogFunc(("Write to Device-Specific capabilities: uOffset: 0x%x, cb: 0x%x\n", 858 // uOffset, cb)); 859 860 rc = virtioScsiR3ConfigAccess(pThis, uOffset, pv, cb, true); 861 862 return rc; 761 863 } 762 864 … … 935 1037 PVIRTIOSCSI pThis = PDMINS_2_DATA(pDevIns, PVIRTIOSCSI); 936 1038 int rc = VINF_SUCCESS; 937 bool fBootable = true;1039 bool fBootable = false; 938 1040 939 1041 pThis->pDevInsR3 = pDevIns; … … 981 1083 pThis->IBase.pfnQueryInterface = virtioScsiR3DeviceQueryInterface; 982 1084 1085 /* Configure virtio_scsi_config that transacts via VirtIO implementation's Dev. Specific Cap callbacks */ 1086 pThis->virtioScsiConfig.uNumQueues = 3; /* controlq, eventq, + n request queues*/ 1087 pThis->virtioScsiConfig.uSegMax = 1024; /* initial guess */ 1088 pThis->virtioScsiConfig.uMaxSectors = 0x10000; 1089 pThis->virtioScsiConfig.uCmdPerLun = 64; /* initial guess */ 1090 pThis->virtioScsiConfig.uEventInfoSize = 100; /* VirtIO 1.0 spec says this should based on # of negotiated features */ 1091 pThis->virtioScsiConfig.uSenseSize = 96; /* from VirtIO 1.0 spec, must restore this on reset */ 1092 pThis->virtioScsiConfig.uCdbSize = 32; /* from VirtIO 1.0 spec, must restore this on reset */ 1093 pThis->virtioScsiConfig.uMaxChannel = 0; /* from VirtIO 1.0 spec */ 1094 pThis->virtioScsiConfig.uMaxTarget = pThis->cTargets; 1095 pThis->virtioScsiConfig.uMaxLun = 16383; /* from VirtIO 1.0 spec */ 1096 983 1097 rc = virtioConstruct(pDevIns, pVirtio, iInstance, pVirtioPciParams, 984 1098 VIRTIOSCSI_NAME_FMT, VIRTIOSCSI_N_QUEUES, VIRTIOSCSI_REGION_PCI_CAP, 985 1099 virtioScsiR3DevCapRead, virtioScsiR3DevCapWrite, 986 sizeof(VIRTIO_ PCI_DEV_CAP_T) /* cbDevSpecificCap */,987 false /* fHaveDevSpecificCap */, 0 /* uNotifyOffMultiplier */);988 1100 sizeof(VIRTIO_SCSI_CONFIG_T) /* cbDevSpecificCap */, 1101 true /* fHaveDevSpecificCap */, 1102 0 /* uNotifyOffMultiplier */); 989 1103 990 1104 if (RT_FAILURE(rc)) 991 1105 return PDMDEV_SET_ERROR(pDevIns, rc, N_("virtio-scsi: failed to initialize VirtIO")); 992 993 1106 994 1107 rc = PDMDevHlpPCIIORegionRegister(pDevIns, VIRTIOSCSI_REGION_MEM_IO, 32, … … 1021 1134 PVIRTIOSCSITARGET pTarget = &pThis->aTargetInstances[iLUN]; 1022 1135 1023 if (RTStrAPrintf(&pTarget->pszLunName, " vSCSI%u", iLUN) < 0)1136 if (RTStrAPrintf(&pTarget->pszLunName, "VSCSI%u", iLUN) < 0) 1024 1137 AssertLogRelFailedReturn(VERR_NO_MEMORY); 1025 1138
Note:
See TracChangeset
for help on using the changeset viewer.