Any comments on this small patch? :-)

On Thu, Apr 7, 2016 at 2:39 PM, Nitesh Konkar <niteshkonkar.libvirt@gmail.com> wrote:
HBA will get treated as vHBA if not returned
after detecting vhba_parent format.

Signed-off-by: Nitesh Konkar <nitkon12@linux.vnet.ibm.com>
---
Before Patch:
# virsh pool-destroy poolhba_name
error: Failed to destroy pool poolhba_name
error: internal error: Invalid adapter name 'pci_000x_0x_00_x' for SCSI pool

# virsh nodedev-dumpxml scsi_host2
<device>
  <name>scsi_host2</name>
  <path>xxxx</path>
  <parent>pci_000x_0x_00_x</parent>
  <capability type='scsi_host'>
    <host>2</host>
    ...
    ...
    <capability type='vport_ops'>
      <max_vports>255</max_vports>
      <vports>0</vports>
    </capability>
  </capability>
</device>

After Patch:
# virsh pool-destroy poolhba_name
Pool poolhba_name destroyed

 src/storage/storage_backend_scsi.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/storage/storage_backend_scsi.c b/src/storage/storage_backend_scsi.c
index e6c8bb5..dd0343f 100644
--- a/src/storage/storage_backend_scsi.c
+++ b/src/storage/storage_backend_scsi.c
@@ -842,6 +842,11 @@ deleteVport(virConnectPtr conn,
         if (!(vhba_parent = virStoragePoolGetVhbaSCSIHostParent(conn, name)))
             goto cleanup;

+        if (STRPREFIX(vhba_parent, "pci")) {
+            ret = 0;
+            goto cleanup;
+        }
+
         if (virGetSCSIHostNumber(vhba_parent, &parent_host) < 0)
             goto cleanup;
     }
--
1.8.3.1