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

Class FileIOStorageObject

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

An interface to configFS storage objects for fileio backstore.

Instance Methods [hide private]
 
__init__(self, name, dev=None, size=None, wwn=None, write_back=False)
A FileIOStorageObject can be instantiated in two ways:
 
_configure(self, dev, size, wwn, write_back)
 
_get_wb_enabled(self)
 
_get_size(self)
 
_is_block(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

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]

Inherited from StorageObject: all, so_from_path

Class Variables [hide private]
  write_back = property(_get_wb_enabled, doc= "True if write-bac...
  size = property(_get_size, doc= "Get the current FileIOStorage...
  is_block = property(_is_block, doc= "True if FileIoStorage is ...

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

Inherited from node.CFSNode: configfs_dir, exists, path

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

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

 

A FileIOStorageObject can be instantiated in two ways:

  • Creation mode: If dev and size are specified, the underlying configFS object will be created with those parameters. No FileIOStorageObject with the same name can pre-exist in the parent Backstore in that mode, or instantiation will fail.
  • Lookup mode: If dev and size are not set, then the FileIOStorageObject 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 FileIOStorageObject.
  • dev (string) - The path to the backend file or block device to be used.
    • Examples: dev="/dev/sda", dev="/tmp/myfile"
    • The only block device type that is accepted TYPE_DISK, or partitions of a TYPE_DISK device. For other device types, use pscsi.
  • size (int) - Size of the object, if not a block device
  • wwn (string) - T10 WWN Unit Serial, will generate if None
  • write_back (bool) - Should we create the StorageObject with write caching enabled? Disabled by default
Returns:
A FileIOStorageObject object.
Overrides: object.__init__

_configure(self, dev, size, wwn, write_back)

 
Overrides: StorageObject._configure

dump(self)

 
Overrides: node.CFSNode.dump

Class Variable Details [hide private]

write_back

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

size

Value:
property(_get_size, doc= "Get the current FileIOStorage size in bytes"\
)

is_block

Value:
property(_is_block, doc= "True if FileIoStorage is backed by a block d\
evice instead of a file")