---
 src/storage/storage_backend_scsi.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/storage/storage_backend_scsi.c 
b/src/storage/storage_backend_scsi.c
index 5635f73..da6a5dd 100644
--- a/src/storage/storage_backend_scsi.c
+++ b/src/storage/storage_backend_scsi.c
@@ -760,18 +760,14 @@ getAdapterName(virStoragePoolSourceAdapter adapter)
 
     if (adapter.type != VIR_STORAGE_POOL_SOURCE_ADAPTER_TYPE_FC_HOST) {
         if (adapter.data.scsi_host.parent) {
-            if (!adapter.data.scsi_host.has_unique_id) {
-                virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                               _("'unique_id' is not specified for "
-                                 "scsi_host adapter"));
+            if (!(addr = 
getScsiHostParentAddress(adapter.data.scsi_host.parent)))
                 return NULL;
-            } else {
-                if (!(addr = 
getScsiHostParentAddress(adapter.data.scsi_host.parent)))
-                    return NULL;
 
+            if (!adapter.data.scsi_host.has_unique_id)
+                name = virGuessStableScsiHostName(NULL, addr);
+            else
                 name = virParseStableScsiHostAddress(NULL, addr,
                                                      
adapter.data.scsi_host.unique_id);
-            }
         } else if (adapter.data.scsi_host.name) {
             if (VIR_STRDUP(name, adapter.data.scsi_host.name) < 0)
                 return NULL;
-- 
1.8.1.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Reply via email to