[PATCH 08/24] Change IBlockBackstore's name to 'block' from 'iblock'

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

 



Although the underlying CFS node is still iblock, we can change the
plugin name string such that the cmdline and save/restore refer to the
backstore as 'block'. This should be less confusing for users, since
nobody knows what the 'i' stands for. :)

Signed-off-by: Andy Grover <agrover@xxxxxxxxxx>
---
 rtslib/tcm.py |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/rtslib/tcm.py b/rtslib/tcm.py
index 7b4703b..4ccd488 100644
--- a/rtslib/tcm.py
+++ b/rtslib/tcm.py
@@ -31,7 +31,7 @@ class Backstore(CFSNode):
 
     # Backstore private stuff
 
-    def __init__(self, plugin, storage_class, index, mode):
+    def __init__(self, plugin, storage_class, index, mode, alt_dirprefix=None):
         super(Backstore, self).__init__()
         if issubclass(storage_class, StorageObject):
             self._storage_object_class = storage_class
@@ -42,8 +42,12 @@ class Backstore(CFSNode):
             self._index = int(index)
         except ValueError:
             raise RTSLibError("Invalid backstore index: %s" % index)
+        if alt_dirprefix:
+            dirp = alt_dirprefix
+        else:
+            dirp = plugin
         self._path = "%s/core/%s_%d" % (self.configfs_dir,
-                                        self._plugin,
+                                        dirp,
                                         self._index)
         self._create_in_cfs_ine(mode)
 
@@ -81,7 +85,7 @@ class Backstore(CFSNode):
 
     def _get_plugin(self):
         self._check_self()
-        return self._parse_info("plugin")
+        return self._plugin
 
     def _get_name(self):
         self._check_self()
@@ -254,8 +258,8 @@ class IBlockBackstore(Backstore):
         @return: An IBlockBackstore object.
         '''
 
-        super(IBlockBackstore, self).__init__("iblock", IBlockStorageObject,
-                                               index, mode)
+        super(IBlockBackstore, self).__init__("block", IBlockStorageObject,
+                                               index, mode, alt_dirprefix="iblock")
 
     # IBlockBackstore public stuff
 
-- 
1.7.1

--
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