Package rtslib :: Module tcm :: Class BlockStorageObject
[hide private]
[frames] | no frames]

Class BlockStorageObject

  object --+        
           |        
node.CFSNode --+    
               |    
   StorageObject --+
                   |
                  BlockStorageObject

An interface to configFS storage objects for block backstore.

Instance Methods [hide private]
 
__init__(self, name, dev=None, wwn=None, readonly=False, write_back=False)
A BlockIOStorageObject can be instantiated in two ways:
 
_configure(self, dev, wwn, readonly)
 
_get_major(self)
 
_get_minor(self)
 
_get_size(self)
 
_get_wb_enabled(self)
 
_get_readonly(self)
 
dump(self)

Inherited from StorageObject: __eq__, __ne__, __repr__, delete, is_configured

Inherited from node.CFSNode: get_attribute, get_parameter, list_attributes, list_parameters, set_attribute, set_parameter

Class Methods [hide private]

Inherited from StorageObject: all, so_from_path

Class Variables [hide private]
  major = property(_get_major, doc= "Get the block device major ...
  minor = property(_get_minor, doc= "Get the block device minor ...
  size = property(_get_size, doc= "Get the block device size")
  write_back = property(_get_wb_enabled, doc= "True if write-bac...
  readonly = property(_get_readonly, doc= "True if the device is...

Inherited from StorageObject: attached_luns, name, status, udev_path, version, wwn

Inherited from node.CFSNode: configfs_dir, exists, path

Method Details [hide private]

__init__(self, name, dev=None, wwn=None, readonly=False, write_back=False)
(Constructor)

 

A BlockIOStorageObject can be instantiated in two ways:

  • Creation mode: If dev is specified, the underlying configFS object will be created with that parameter. No BlockIOStorageObject with the same name can pre-exist in the parent Backstore in that mode.
  • Lookup mode: If dev is not set, then the BlockIOStorageObject will be bound to the existing configFS object in the parent Backstore having the specified name. The underlying configFS object must already exist in that mode, or instantiation will fail.
Parameters:
  • name (string) - The name of the BlockIOStorageObject.
  • dev (string) - The path to the backend block device to be used.
    • Example: dev="/dev/sda".
    • The only device type that is accepted TYPE_DISK. For other device types, use pscsi.
  • wwn (string) - T10 WWN Unit Serial, will generate if None
Returns:
A BlockIOStorageObject object.
Overrides: node.CFSNode.__init__

_configure(self, dev, wwn, readonly)

 
Overrides: StorageObject._configure

dump(self)

 
Overrides: node.CFSNode.dump

Class Variable Details [hide private]

major

Value:
property(_get_major, doc= "Get the block device major number")

minor

Value:
property(_get_minor, doc= "Get the block device minor number")

write_back

Value:
property(_get_wb_enabled, doc= "True if write-back, False if write-thr\
ough (write cache disabled)")

readonly

Value:
property(_get_readonly, doc= "True if the device is read-only, False i\
f read/write")