Blame SOURCES/libvirt-storage-Returns-earlier-if-source-adapter-of-the-scsi-pool-is-a-HBA.patch

c401cc
From 85a9692bb630be29ff07a7ffa1c1eec3fbcd022b Mon Sep 17 00:00:00 2001
c401cc
Message-Id: <85a9692bb630be29ff07a7ffa1c1eec3fbcd022b.1385135432.git.jdenemar@redhat.com>
c401cc
From: Osier Yang <jyang@redhat.com>
c401cc
Date: Thu, 21 Nov 2013 12:24:57 +0800
c401cc
Subject: [PATCH] storage: Returns earlier if source adapter of the scsi pool
c401cc
 is a HBA
c401cc
c401cc
https://bugzilla.redhat.com/show_bug.cgi?id=1027680
c401cc
c401cc
It makes no sense to go forward to get the parent host number of a
c401cc
HBA, and treat the HBA as a vHBA with trying to delete it.
c401cc
c401cc
Signed-off-by: Osier Yang <jyang@redhat.com>
c401cc
(cherry picked from commit b96651dec09850dcc9fdace5a149c06a793f611e)
c401cc
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c401cc
---
c401cc
 src/storage/storage_backend_scsi.c | 8 ++++++++
c401cc
 1 file changed, 8 insertions(+)
c401cc
c401cc
diff --git a/src/storage/storage_backend_scsi.c b/src/storage/storage_backend_scsi.c
c401cc
index 8cb762a..64b7843 100644
c401cc
--- a/src/storage/storage_backend_scsi.c
c401cc
+++ b/src/storage/storage_backend_scsi.c
c401cc
@@ -664,6 +664,14 @@ deleteVport(virStoragePoolSourceAdapter adapter)
c401cc
     if (adapter.type != VIR_STORAGE_POOL_SOURCE_ADAPTER_TYPE_FC_HOST)
c401cc
         return 0;
c401cc
 
c401cc
+    /* It must be a HBA instead of a vHBA as long as "parent"
c401cc
+     * is NULL. "createVport" guaranteed "parent" for a vHBA
c401cc
+     * cannot be NULL, it's either specified in XML, or detected
c401cc
+     * automatically.
c401cc
+     */
c401cc
+    if (!adapter.data.fchost.parent)
c401cc
+        return 0;
c401cc
+
c401cc
     if (!(virGetFCHostNameByWWN(NULL, adapter.data.fchost.wwnn,
c401cc
                                 adapter.data.fchost.wwpn)))
c401cc
         return -1;
c401cc
-- 
c401cc
1.8.4.4
c401cc