Package rtslib :: Module tcm :: Class UserBackedStorageObject

[hide private]
[frames] | no frames]

# Class UserBackedStorageObject

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

An interface to configFS storage objects for userspace-backed backstore.

Instance Methods | [hide private]

__init__(self, name, config=None, level=None, size=None, wwn=None) Returns: A UserBackedStorageObject object. |

_configure(self, config, level, size, wwn) |

_get_size(self) |

_get_level(self) |

_get_config(self) |

dump(self) |

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

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

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

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

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]

Inherited from `node.CFSNode`: `configfs_dir`

Properties | [hide private]

| size Get the size in bytes.
| level Get the command emulation level.
| config Get the TCMU config.
Inherited from `StorageObject`: `attached_luns`, `name`, `status`, `udev_path`, `version`, `wwn` Inherited from `node.CFSNode`: `exists`, `path` Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, name, config=None, level=None, size=None, wwn=None)
(Constructor)

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  - `name` (string) - The name of the UserBackedStorageObject.
  - `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.
  - `size` (int) - The size of the device to create, in bytes.
  - `config` (string) - user-handler-specific config string.
    - e.g. "rbd/machine1@snap4"
  - `level` (int) - TCMU emulation level, 0 or 1. Level 0 will pass all SCSI commands, 1 will just pass I/O commands, READ, WRITE, etc.
Returns:
  A UserBackedStorageObject object.
Overrides: object.__init__

### _configure(self, config, level, size, wwn)

Overrides: StorageObject._configure

### dump(self)

Overrides: node.CFSNode.dump

Property Details | [hide private]

### size

Get the size in bytes.

Get Method:
  _get_size(self)

### level

Get the command emulation level.

Get Method:
  _get_level(self)

### config

Get the TCMU config.

Get Method:
  _get_config(self)