提交 51ed8907 编写于 作者: J John Ferlan

nodedev: Need to check for vport capable scsi_host for vHBA searches

When searching for an NPIV capable fc_host, not only does there need to
be an "fc_host" capability with the specified wwnn/wwpn or fabric_wwn,
but that scsi_host must be vport capable; otherwise, one could end up
picking an exising vHBA/NPIV which wouldn't be good.

Currently not a problem since scsi_hosts are in an as found forward linked
list and the vport capable scsi_hosts will always appear before a vHBA by
definition. However, in the near term future a hash table will be used to
lookup the devices and that could cause problems for these algorithms.
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
上级 9c9a12ca
......@@ -165,7 +165,8 @@ virNodeDeviceFindByWWNs(virNodeDeviceObjListPtr devs,
virNodeDeviceObjLock(devs->objs[i]);
if ((cap = virNodeDeviceFindFCCapDef(devs->objs[i])) &&
STREQ_NULLABLE(cap->data.scsi_host.wwnn, parent_wwnn) &&
STREQ_NULLABLE(cap->data.scsi_host.wwpn, parent_wwpn))
STREQ_NULLABLE(cap->data.scsi_host.wwpn, parent_wwpn) &&
virNodeDeviceFindVPORTCapDef(devs->objs[i]))
return devs->objs[i];
virNodeDeviceObjUnlock(devs->objs[i]);
}
......@@ -184,7 +185,8 @@ virNodeDeviceFindByFabricWWN(virNodeDeviceObjListPtr devs,
virNodeDevCapsDefPtr cap;
virNodeDeviceObjLock(devs->objs[i]);
if ((cap = virNodeDeviceFindFCCapDef(devs->objs[i])) &&
STREQ_NULLABLE(cap->data.scsi_host.fabric_wwn, parent_fabric_wwn))
STREQ_NULLABLE(cap->data.scsi_host.fabric_wwn, parent_fabric_wwn) &&
virNodeDeviceFindVPORTCapDef(devs->objs[i]))
return devs->objs[i];
virNodeDeviceObjUnlock(devs->objs[i]);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册