Print this page
NEX-3705 Need to update libses with LID/USN code from sesctld
Reviewed by: Dan Fields <dan.fields@nexenta.com>
Reviewed by: Rob Gittins <rob.gittins@nexenta.com>
Reviewed by: Hans Rosenfeld <hans.rosenfeld@nexenta.com>

@@ -19,10 +19,11 @@
  * CDDL HEADER END
  */
 
 /*
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
  */
 
 #include <sys/types.h>
 #include <sys/isa_defs.h>
 #include <sys/systeminfo.h>

@@ -196,10 +197,15 @@
         if (libscsi_get_inquiry(hp, tp) != 0) {
                 libscsi_close(hp, tp);
                 return (NULL);
         }
 
+        if (libscsi_get_inquiry_dev_id(hp, tp) != 0)
+                tp->lst_lid = NULL;
+        if (libscsi_get_inquiry_usn(hp, tp) != 0)
+                tp->lst_usn = NULL;
+
         return (tp);
 }
 
 libscsi_hdl_t *
 libscsi_get_handle(libscsi_target_t *tp)

@@ -212,10 +218,14 @@
 {
         tp->lst_engine->lse_ops->lseo_close(hp, tp->lst_priv);
         libscsi_free(hp, tp->lst_vendor);
         libscsi_free(hp, tp->lst_product);
         libscsi_free(hp, tp->lst_revision);
+        if (tp->lst_lid != NULL)
+                libscsi_free(hp, tp->lst_lid);
+        if (tp->lst_usn != NULL)
+                libscsi_free(hp, tp->lst_usn);
         libscsi_free(hp, tp);
         --hp->lsh_targets;
 }
 
 sam4_status_t