Class: QEMU::Command::Disk
- Inherits:
-
Object
- Object
- QEMU::Command::Disk
- Defined in:
- lib/qemu/command.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(file, options = {}) ⇒ Disk
constructor
A new instance of Disk.
- #qemu_drive(index) ⇒ Object
Constructor Details
#initialize(file, options = {}) ⇒ Disk
Returns a new instance of Disk.
37 38 39 40 |
# File 'lib/qemu/command.rb', line 37 def initialize(file, = {}) self.file = file self. = { :media => "disk" }.merge end |
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
35 36 37 |
# File 'lib/qemu/command.rb', line 35 def file @file end |
#options ⇒ Object
Returns the value of attribute options.
35 36 37 |
# File 'lib/qemu/command.rb', line 35 def @options end |
Instance Method Details
#qemu_drive(index) ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/qemu/command.rb', line 42 def qemu_drive(index) { :file => File.(file), :index => index, :if => "virtio" }.merge().map { |k,v| "#{k}=#{v}" }.join(',') end |