# File lib/virt/volume.rb, line 6 def initialize options = {} @connection = Virt.connection self.name = options[:name] || raise("Volume requires a name") # If our volume already exists, we ignore the provided options and defaults @pool = options[:pool].nil? ? default_pool : @connection.host.storage_pool(options[:pool]) fetch_volume @type ||= options[:type] || default_type @allocated_size ||= options[:allocated_size] || default_allocated_size @template_path ||= options[:template_path] || default_template_path @size ||= options[:size] || default_size end