Class: LVM::LVConfig
- Inherits:
-
Object
- Object
- LVM::LVConfig
- Defined in:
- lib/lvm/lv_config.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #chunk_size ⇒ Object
- #cow_store ⇒ Object
- #device_id ⇒ Object
-
#initialize(tree, name, vgcfg) ⇒ LVConfig
constructor
A new instance of LVConfig.
- #origin ⇒ Object
- #snapshot? ⇒ Boolean
- #thin? ⇒ Boolean
- #thin_pool ⇒ Object
Constructor Details
#initialize(tree, name, vgcfg) ⇒ LVConfig
Returns a new instance of LVConfig.
6 7 8 9 10 |
# File 'lib/lvm/lv_config.rb', line 6 def initialize(tree, name, vgcfg) @root = tree @name = name @vgcfg = vgcfg end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/lvm/lv_config.rb', line 4 def name @name end |
Instance Method Details
#chunk_size ⇒ Object
36 37 38 |
# File 'lib/lvm/lv_config.rb', line 36 def chunk_size @root.groups['segment1'].variable_value('chunk_size') * 512 end |
#cow_store ⇒ Object
32 33 34 |
# File 'lib/lvm/lv_config.rb', line 32 def cow_store @root.groups['segment1'].variable_value('cow_store') end |
#device_id ⇒ Object
24 25 26 |
# File 'lib/lvm/lv_config.rb', line 24 def device_id @root.groups['segment1'].variable_value('device_id') end |
#origin ⇒ Object
28 29 30 |
# File 'lib/lvm/lv_config.rb', line 28 def origin @root.groups['segment1'].variable_value('origin') end |
#snapshot? ⇒ Boolean
16 17 18 |
# File 'lib/lvm/lv_config.rb', line 16 def snapshot? thin? ? !origin.nil? : !@vgcfg.logical_volumes.values.find { |lv| lv.cow_store == name }.nil? end |
#thin? ⇒ Boolean
12 13 14 |
# File 'lib/lvm/lv_config.rb', line 12 def thin? @root.groups['segment1'].variable_value('type') == 'thin' end |
#thin_pool ⇒ Object
20 21 22 |
# File 'lib/lvm/lv_config.rb', line 20 def thin_pool @root.groups['segment1'].variable_value('thin_pool') end |