From: Dennis Chen Date: Fri, 28 Jun 2013 09:59:51 +0000 (+0200) Subject: Fix vPort management: FC vHBA creation X-Git-Tag: v1.0.5.3~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d21d845326ca0e3a342bef1204a1216ef86d885;p=thirdparty%2Flibvirt.git 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 reverts f90af69 which switched wwpn & wwwn in the wrong place. https://www.kernel.org/doc/Documentation/scsi/scsi_fc_transport.txt (cherry picked from commit 3c0d5e224c71cd85b123cd938eeb360502503cb0) --- diff --git a/src/storage/storage_backend_scsi.c b/src/storage/storage_backend_scsi.c index 987d218509..33539af44e 100644 --- a/src/storage/storage_backend_scsi.c +++ b/src/storage/storage_backend_scsi.c @@ -671,8 +671,8 @@ createVport(virStoragePoolSourceAdapter adapter) if (getHostNumber(adapter.data.fchost.parent, &parent_host) < 0) return -1; - if (virManageVport(parent_host, adapter.data.fchost.wwnn, - adapter.data.fchost.wwpn, VPORT_CREATE) < 0) + if (virManageVport(parent_host, adapter.data.fchost.wwpn, + adapter.data.fchost.wwnn, VPORT_CREATE) < 0) return -1; virFileWaitForDevices(); @@ -694,8 +694,8 @@ deleteVport(virStoragePoolSourceAdapter adapter) if (getHostNumber(adapter.data.fchost.parent, &parent_host) < 0) return -1; - if (virManageVport(parent_host, adapter.data.fchost.wwnn, - adapter.data.fchost.wwpn, VPORT_DELETE) < 0) + if (virManageVport(parent_host, adapter.data.fchost.wwpn, + adapter.data.fchost.wwnn, VPORT_DELETE) < 0) return -1; return 0; diff --git a/src/util/virutil.c b/src/util/virutil.c index 173c74d00f..49ae7fbd6d 100644 --- a/src/util/virutil.c +++ b/src/util/virutil.c @@ -3559,8 +3559,8 @@ virManageVport(const int parent_host, if (virAsprintf(&vport_name, "%s:%s", - wwnn, - wwpn) < 0) { + wwpn, + wwnn) < 0) { virReportOOMError(); goto cleanup; }