class Virt::Pool

implements Libvirt pool, at the moment it is assumed to be a file based pool.

Attributes

name[R]
to_s[R]

Public Class Methods

new(options = {}) click to toggle source
# File lib/virt/pool.rb, line 6
def initialize options = {}
  @name = options[:name] || raise("Must Provide a pool name")
  @connection = Virt.connection
  fetch_pool
end

Public Instance Methods

create_vol(vol) click to toggle source
# File lib/virt/pool.rb, line 39
def create_vol vol
  raise "Must provide a Virt::Volume object" unless vol.is_a?(Virt::Volume)
  raise "Pool not saved, cant create volume" if new?
  @pool.create_vol_xml vol.xml
end
new?() click to toggle source
# File lib/virt/pool.rb, line 18
def new?
  @pool.nil?
end
path() click to toggle source
# File lib/virt/pool.rb, line 35
def path
  document "pool/target/path"
end
save() click to toggle source
# File lib/virt/pool.rb, line 14
def save
  raise "not implemented"
end
volumes() click to toggle source
# File lib/virt/pool.rb, line 22
def volumes
  @pool.list_volumes
end