[PATCH 1/2] rtslib: Add support for iser get/set attribute in NetworkPortal class

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

 



From: Nicholas Bellinger <nab@xxxxxxxxxxxxxxxxxxxxx>

Signed-off-by: Nicholas Bellinger <nab@xxxxxxxxxxxxxxxxxxxxx>
---
 rtslib/target.py |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/rtslib/target.py b/rtslib/target.py
index a936223..59aabcb 100644
--- a/rtslib/target.py
+++ b/rtslib/target.py
@@ -863,6 +863,27 @@ class NetworkPortal(CFSNode):
     def _get_parent_tpg(self):
         return self._parent_tpg
 
+    def _set_iser_attr(self, iser_attr):
+        path = "%s/iser" % self.path
+        if os.path.isfile(path):
+            if iser_attr:
+                fwrite(path, "1")
+            else:
+                fwrite(path, "0")
+        else:
+            raise RTSLibError("iser network portal attribute does not exist.")
+
+    def _get_iser_attr(self):
+        path = "%s/iser" % self.path
+        if os.path.isfile(path):
+            iser_attr = fread(path).strip()
+            if iser_attr == "1":
+                return True
+            else:
+                return False
+        else:
+            return False
+
     # NetworkPortal public stuff
 
     parent_tpg = property(_get_parent_tpg,
-- 
1.7.2.5

--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux