mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-08 05:55:19 +00:00
Fix vPort management: FC vHBA creation
When creating a virtual FC HBA with virsh/libvirt API, an error message will be returned: "error: Node device not found", also the 'nodedev-dumpxml' shows wrong information of wwpn & wwnn for the new created device. Signed-off-by: xschen@tnsoft.com.cn This revertsf90af69
which switched wwpn & wwwn in the wrong place. https://www.kernel.org/doc/Documentation/scsi/scsi_fc_transport.txt (cherry picked from commit3c0d5e224c
)
This commit is contained in:
parent
0347e778ca
commit
4d21d84532
@ -671,8 +671,8 @@ createVport(virStoragePoolSourceAdapter adapter)
|
|||||||
if (getHostNumber(adapter.data.fchost.parent, &parent_host) < 0)
|
if (getHostNumber(adapter.data.fchost.parent, &parent_host) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (virManageVport(parent_host, adapter.data.fchost.wwnn,
|
if (virManageVport(parent_host, adapter.data.fchost.wwpn,
|
||||||
adapter.data.fchost.wwpn, VPORT_CREATE) < 0)
|
adapter.data.fchost.wwnn, VPORT_CREATE) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
virFileWaitForDevices();
|
virFileWaitForDevices();
|
||||||
@ -694,8 +694,8 @@ deleteVport(virStoragePoolSourceAdapter adapter)
|
|||||||
if (getHostNumber(adapter.data.fchost.parent, &parent_host) < 0)
|
if (getHostNumber(adapter.data.fchost.parent, &parent_host) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (virManageVport(parent_host, adapter.data.fchost.wwnn,
|
if (virManageVport(parent_host, adapter.data.fchost.wwpn,
|
||||||
adapter.data.fchost.wwpn, VPORT_DELETE) < 0)
|
adapter.data.fchost.wwnn, VPORT_DELETE) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -3559,8 +3559,8 @@ virManageVport(const int parent_host,
|
|||||||
|
|
||||||
if (virAsprintf(&vport_name,
|
if (virAsprintf(&vport_name,
|
||||||
"%s:%s",
|
"%s:%s",
|
||||||
wwnn,
|
wwpn,
|
||||||
wwpn) < 0) {
|
wwnn) < 0) {
|
||||||
virReportOOMError();
|
virReportOOMError();
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user