]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix vPort management: FC vHBA creation
authorDennis Chen <xschen@tnsoft.com.cn>
Fri, 28 Jun 2013 09:59:51 +0000 (11:59 +0200)
committerJán Tomko <jtomko@redhat.com>
Mon, 1 Jul 2013 11:32:05 +0000 (13:32 +0200)
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)

src/storage/storage_backend_scsi.c
src/util/virutil.c

index bd6a2a96a1a74781ced9c91c96aa07dc239da7f5..9f5958a5b37bb50cdcfdf47e93da1c4aeff6757a 100644 (file)
@@ -667,8 +667,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();
@@ -690,8 +690,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;
index a29da14ece26a6084e9ab03aa862933b55391513..e11a02f7f1311165dc4bc9b8caefbbb7801498e1 100644 (file)
@@ -1791,8 +1791,8 @@ virManageVport(const int parent_host,
 
     if (virAsprintf(&vport_name,
                     "%s:%s",
-                    wwnn,
-                    wwpn) < 0) {
+                    wwpn,
+                    wwnn) < 0) {
         virReportOOMError();
         goto cleanup;
     }