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

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



On 20/06/13 03:00, John Ferlan wrote:
On 06/07/2013 01:03 PM, Osier Yang wrote:
---
  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)))
I don't understand the code churn that takes place for getAdapterName -
is it really required to make the change in 7/11 especially since you're
just undoing it here?  That is between patches 7-10 if getAdapterName()
didn't support the parent fields, would it matter?

7/10's purpose is to find the scsi host by specified "parent" and "unique_id",
but omitted "unique_id" was not supported. That says it matters.


                  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);
Still need to VIR_FREE(addr);

John
-            }
          } else if (adapter.data.scsi_host.name) {
              if (VIR_STRDUP(name, adapter.data.scsi_host.name) < 0)
                  return NULL;



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