summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Grover <agrover@redhat.com>2011-12-05 11:22:49 -0800
committerAndy Grover <agrover@redhat.com>2011-12-05 14:05:10 -0800
commitede5917babe703cb8c22a4b61fb2cb474f61aa4b (patch)
tree612ca7431ec3370f6c3906460a9b4dee6365ce42
parentaa57ceb14b379df0fd96e0fcee3e78783131149e (diff)
downloadrtslib-fb-ede5917babe703cb8c22a4b61fb2cb474f61aa4b.tar.gz
Remove support for RD_DR backstore & storage objects
They are no longer supported in LIO. Signed-off-by: Andy Grover <agrover@redhat.com>
-rw-r--r--rtslib/__init__.py4
-rw-r--r--rtslib/root.py5
-rw-r--r--rtslib/tcm.py122
3 files changed, 3 insertions, 128 deletions
diff --git a/rtslib/__init__.py b/rtslib/__init__.py
index f2ffec4..9983c8e 100644
--- a/rtslib/__init__.py
+++ b/rtslib/__init__.py
@@ -25,8 +25,8 @@ from target import NodeACL, NetworkPortal, TPG, Target, FabricModule
from tcm import FileIOBackstore, IBlockBackstore
from tcm import FileIOStorageObject, IBlockStorageObject
-from tcm import PSCSIBackstore, RDDRBackstore, RDMCPBackstore
-from tcm import PSCSIStorageObject, RDDRStorageObject, RDMCPStorageObject
+from tcm import PSCSIBackstore, RDMCPBackstore
+from tcm import PSCSIStorageObject, RDMCPStorageObject
__version__ = 'GIT_VERSION'
__author__ = "Jerome Martin <jxm@risingtidesystems.com>"
diff --git a/rtslib/root.py b/rtslib/root.py
index 6daef9b..1e67b02 100644
--- a/rtslib/root.py
+++ b/rtslib/root.py
@@ -24,7 +24,7 @@ import glob
from node import CFSNode
from target import Target, FabricModule
from tcm import FileIOBackstore, IBlockBackstore
-from tcm import PSCSIBackstore, RDDRBackstore, RDMCPBackstore
+from tcm import PSCSIBackstore, RDMCPBackstore
from utils import RTSLibError, RTSLibBrokenLink, flatten_nested_list, modprobe
class RTSRoot(CFSNode):
@@ -92,9 +92,6 @@ class RTSRoot(CFSNode):
elif regex.group(1) == "iblock":
backstores.add(
IBlockBackstore(int(regex.group(3)), 'lookup'))
- elif regex.group(1) == "rd_dr":
- backstores.add(
- RDDRBackstore(int(regex.group(3)), 'lookup'))
elif regex.group(1) == "rd_mcp":
backstores.add(
RDMCPBackstore(int(regex.group(3)), 'lookup'))
diff --git a/rtslib/tcm.py b/rtslib/tcm.py
index 4da49b0..b15d5d5 100644
--- a/rtslib/tcm.py
+++ b/rtslib/tcm.py
@@ -170,38 +170,6 @@ class PSCSIBackstore(Backstore):
doc="Get the legacy mode flag. If True, the Vitualbackstore "
+ " index must match the StorageObjects real HBAs.")
-class RDDRBackstore(Backstore):
- '''
- This is an interface to rd_dr backstore plugin objects in configFS.
- A RDDRBackstore object is identified by its backstore index.
- '''
-
- # RDDRBackstore private stuff
-
- def __init__(self, index, mode='any'):
- '''
- @param index: The backstore index.
- @type index: int
- @param mode: An optionnal string containing the object creation mode:
- - I{'any'} the configFS object will be either lookupd or created.
- - I{'lookup'} the object MUST already exist configFS.
- - I{'create'} the object must NOT already exist in configFS.
- @type mode:string
- @return: A RDDRBackstore object.
- '''
-
- super(RDDRBackstore, self).__init__("rd_dr", RDDRStorageObject,
- index, mode)
-
- # RDDRBackstore public stuff
-
- def storage_object(self, name, size=None, gen_wwn=True):
- '''
- Same as RDDRStorageObject() without specifying the backstore
- '''
- self._check_self()
- return RDDRStorageObject(self, name=name,
- size=size, gen_wwn=gen_wwn)
class RDMCPBackstore(Backstore):
'''
@@ -656,96 +624,6 @@ class PSCSIStorageObject(StorageObject):
lun = property(_get_lun,
doc="Get the SCSI device LUN")
-class RDDRStorageObject(StorageObject):
- '''
- An interface to configFS storage objects for rd_dr backstore.
- '''
-
- # RDDRStorageObject private stuff
-
- def __init__(self, backstore, name, size=None, gen_wwn=True):
- '''
- A RDDRStorageObject can be instanciated in two ways:
- - B{Creation mode}: If I{size} is specified, the underlying
- configFS object will be created with that parameter.
- No RDDRStorageObject with the same I{name} can pre-exist in the
- parent RDDRBackstore in that mode, or instanciation will fail.
- - B{Lookup mode}: If I{size} is not set, then the RDDRStorageObject
- will be bound to the existing configFS object in the parent
- RDDRBackstore having the specified I{name}.
- The underlying configFS object must already exist in that mode,
- or instanciation will fail.
-
- @param backstore: The parent backstore of the RDDRStorageObject.
- @type backstore: RDDRBackstore
- @param name: The name of the RDDRStorageObject.
- @type name: string
- @param size: The size of the ramdrive to create:
- - If size is an int, it represents a number of bytes
- - If size is a string, the following units can be used :
- - I{B} or no unit present for bytes
- - I{k}, I{K}, I{kB}, I{KB} for kB (kilobytes)
- - I{m}, I{M}, I{mB}, I{MB} for MB (megabytes)
- - I{g}, I{G}, I{gB}, I{GB} for GB (gigabytes)
- - I{t}, I{T}, I{tB}, I{TB} for TB (terabytes)
- Example: size="1MB" for a one megabytes storage object.
- - Note that the size will be rounded to the closest 4096 Bytes
- RAM pages count. For instance, a size of 100000 Bytes will be
- rounded to 24 pages, really 98304 Bytes.
- - The base value for kilo is 1024, aka 1kB = 1024B.
- Strictly speaking, we use kiB, MiB, etc.
- @type size: string or int
- @param gen_wwn: Should we generate a T10 WWN Unit Serial ?
- @type gen_wwn: bool
- @return: A RDDRStorageObject object.
- '''
-
- if size is not None:
- super(RDDRStorageObject, self).__init__(backstore, RDDRBackstore,
- name, 'create')
- try:
- self._configure(size, gen_wwn)
- except:
- self.delete()
- raise
- else:
- super(RDDRStorageObject, self).__init__(backstore, RDDRBackstore,
- name, 'lookup')
-
- def _configure(self, size, wwn):
- self._check_self()
- size = convert_human_to_bytes(size)
- # convert to 4k pages
- size = round(float(size)/4096)
- if size == 0:
- size = 1
-
- self._control("rd_pages=%d" % size)
- self._enable()
- if wwn:
- self.wwn = generate_wwn('unit_serial')
-
- def _get_page_size(self):
- self._check_self()
- return int(self._parse_info("PAGES/PAGE_SIZE").split('*')[1])
-
- def _get_pages(self):
- self._check_self()
- return int(self._parse_info("PAGES/PAGE_SIZE").split('*')[0])
-
- def _get_size(self):
- self._check_self()
- size = self._get_page_size() * self._get_pages()
- return size
-
- # RDDRStorageObject public stuff
-
- page_size = property(_get_page_size,
- doc="Get the ramdisk page size.")
- pages = property(_get_pages,
- doc="Get the ramdisk number of pages.")
- size = property(_get_size,
- doc="Get the ramdisk size in bytes.")
class RDMCPStorageObject(StorageObject):
'''