[vioscsi]. Fix for  Bug - Win7/win2008 guest BSOD after the first reboot when installing os with virtio_scsi
@@ -706,17 +706,13 @@ ENTER_FN();
return FALSE;
}
- for (index = 0; index < adaptExt->num_queues; ++index) {
- PREQUEST_LIST element = &adaptExt->pending_list[index];
- InitializeListHead(&element->srb_list);
- KeInitializeSpinLock(&element->srb_list_lock);
#ifdef USE_CPU_TO_VQ_MAP
if (!CHECKFLAG(adaptExt->perfFlags, STOR_PERF_ADV_CONFIG_LOCALITY)) {
- adaptExt->cpu_to_vq_map[index] = (UCHAR)(index - VIRTIO_SCSI_REQUEST_QUEUE_0);
+ for (index = 0; index < adaptExt->num_queues; ++index) {
+ adaptExt->cpu_to_vq_map[index] = (UCHAR)(index);
}
-#endif // USE_CPU_TO_VQ_MAP
-
}
+#endif // USE_CPU_TO_VQ_MAP
}
else
{
@@ -727,6 +723,12 @@ ENTER_FN();
}
}
+ for (index = 0; index < adaptExt->num_queues; ++index) {
+ PREQUEST_LIST element = &adaptExt->pending_list[index];
+ InitializeListHead(&element->srb_list);
+ KeInitializeSpinLock(&element->srb_list_lock);
+ }
+
if (!adaptExt->dump_mode) {
/* we don't get another chance to call StorPortEnablePassiveInitialization and initialize
* DPCs if the adapter is being restarted, so leave our datastructures alone on restart
