Package rtslib :: Module tcm :: Class IBlockStorageObject

[hide private]
[frames] | no frames]

# Class IBlockStorageObject

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

An interface to configFS storage objects for iblock backstore.

Instance Methods | [hide private]

__init__(self, backstore, name, dev=None, gen_wwn=True) A BlockIOStorageObject can be instantiated in two ways: |

_configure(self, dev, wwn) |

_get_major(self) |

_get_minor(self) |

Inherited from `StorageObject`: `delete`, `is_configured`

Inherited from `StorageObject` (private): `_control`, `_enable`, `_gen_attached_luns`, `_get_backstore`, `_get_name`, `_get_status`, `_get_udev_path`, `_get_wwn`, `_list_attached_luns`, `_parse_info`, `_set_udev_path`, `_set_wwn`, `_write_fd`

Inherited from `node.CFSNode`: `__nonzero__`, `__str__`, `get_attribute`, `get_auth_attr`, `get_parameter`, `list_attributes`, `list_auth_attrs`, `list_parameters`, `set_attribute`, `set_auth_attr`, `set_parameter`

Inherited from `node.CFSNode` (private): `_check_self`, `_create_in_cfs_ine`, `_exists`, `_get_path`, `_is_fresh`, `_list_files`

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

Class Variables | [hide private]

Inherited from `node.CFSNode`: `alua_metadata_dir`, `configfs_dir`, `spec_dir`

Properties | [hide private]

| major Get the block device major number
| minor Get the block device minor number
Inherited from `StorageObject`: `attached_luns`, `backstore`, `name`, `status`, `udev_path`, `wwn` Inherited from `node.CFSNode`: `exists`, `is_fresh`, `path` Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, backstore, name, dev=None, gen_wwn=True)
(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 BlockIOBackstore in that mode.
- Lookup mode: If dev is not set, then the BlockIOStorageObject will be bound to the existing configFS object in the parent BlockIOBackstore having the specified name. The underlying configFS object must already exist in that mode, or instantiation will fail.

Parameters:
  - `backstore` (BlockIOBackstore) - The parent backstore of the BlockIOStorageObject.
  - `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.
  - `gen_wwn` (bool) - Should we generate a T10 WWN Unit Serial when creating the object ?
Returns:
  A BlockIOStorageObject object.
Overrides: object.__init__

Property Details | [hide private]

### major

Get the block device major number

Get Method:
  _get_major(self)

### minor

Get the block device minor number

Get Method:
  _get_minor(self)