Sha256: 151b4ac0c5add19ffd2266f310e6ca6e1a59e4bf65efd3c36d8c1f8213f11eff

Contents?: true

Size: 853 Bytes

Versions: 6

Compression:

Stored size: 853 Bytes

Contents

require_relative 'box'
require 'rexml/document'

module VagrantMutate
  module Box
    class Kvm < Box

      def initialize(env, name, dir)
        super
        @provider_name    = 'kvm'
        @supported_input  = true
        @supported_output = true
        @image_format     = 'qcow2'
        @image_name       = 'box-disk1.img'
      end

      # TODO implement these methods
      # architecture, mac_address, cpus, memory
      # to support converting to providers besides libvirt

      def disk_interface
        domain_file = File.join( @dir, 'box.xml' )
        begin
          domain = REXML::Document.new( File.read(domain_file) )
          domain.elements['/domain/devices/disk/target'].attributes['bus']
        rescue => e
          raise Errors::BoxAttributeError, :error_message => e.message
        end
      end

    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
vagrant-mutate-0.3.2 lib/vagrant-mutate/box/kvm.rb
vagrant-mutate-0.3.1 lib/vagrant-mutate/box/kvm.rb
vagrant-mutate-0.3.0 lib/vagrant-mutate/box/kvm.rb
vagrant-mutate-0.2.6 lib/vagrant-mutate/box/kvm.rb
vagrant-mutate-0.2.5 lib/vagrant-mutate/box/kvm.rb
vagrant-mutate-0.2.4 lib/vagrant-mutate/box/kvm.rb