版本高于2.6.21的linux kernel无法引导scsi控制器类型为lsi控制器的vmware虚拟机

看来vmware对linux 2.6.x系列的kernel实在是比较感冒,很不幸的,又让我遇到了bug。
故障现象:版本高于2.6.21的linux kernel无法引导scsi控制器类型为lsi控制器的vmware虚拟机 所对应vmware版本:Esx 2.5.x全系列,3.0.x系列不详 Server 系列不详 Workstation 6.0 RC1以前版本
原因:2.6.21及之后的kernel里面所带的lsi驱动模块MPT driver 升级到了3.04.04版本,这个版本的MPT驱动里面新增加了一些debug的处理,并改变了取lsi控制器上挂接的scsi设备的取值方法。然后呢,vmware模拟实现lsi控制器上存在的缺陷就冒了出来了,导致新版本的驱动认为虚拟机里面的lsi控制器上根本就没有挂接scsi设备……
老外的解释如下: VMware emulation is broken, its PortFact’s MaxDevices reports value programmed by IOC Init, so if you program IOC Init to 256 (which is 0,as that field is only 8 bit), it reports back 0 in port facts, instead of 256… And unfortunately using 256 triggers another bug in the code (parallel SCSI can have only 16 devices). 更详细的内容可以去看redhat的Bugzilla Bug 230703。
解决方法: 等vmware修正错误的patch 换回2.6.19kernel里面的3.04.03版本的MPT driver。
给要编译的>2.6.20的linux kernel打个patch 复制内容到剪贴板 代码: — linux.org/drivers/message/fusion/mptbase.c 2007-09-24 13:47:28.000000000 -0700 +++ linux/drivers/message/fusion/mptbase.c 2007-09-24 17:45:51.000000000 -0700 @@ -2564,6 +2564,16 @@ pfacts->IOCStatus = le16_to_cpu(pfacts->IOCStatus); pfacts->IOCLogInfo = le32_to_cpu(pfacts->IOCLogInfo); pfacts->MaxDevices = le16_to_cpu(pfacts->MaxDevices); + /* + * VMware emulation is broken, its PortFact’s MaxDevices reports value + * programmed by IOC Init, so if you program IOC Init to 256 (which is 0, + * as that field is only 8 bit), it reports back 0 in port facts, instead + * of 256… And unfortunately using 256 triggers another bug in the + * code (parallel SCSI can have only 16 devices). + */ + if (pfacts->MaxDevices == 0) { + pfacts->MaxDevices = 16; + } pfacts->ortSCSIID = le16_to_cpu(pfacts->ortSCSIID); pfacts->rotocolFlags = le16_to_cpu(pfacts->rotocolFlags); pfacts->MaxPostedCmdBuffers = le16_to_cpu(pfacts->MaxPostedCmdBuffers);

小伟子  发表于: 2009-09-28

我要回答

电子邮件地址不会被公开。 必填项已用*标注

敬请读者进行回答,本站保留删除与本问题无关和不雅内容的权力。

相关推荐