[PATCH 11/11] storage_scsi: Allow the omitted 'unique_id'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 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@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]