Add kernel/initrd/cmd_line directives for the qemu driver

This commit is contained in:
Matt 2014-01-07 13:45:57 +01:00
parent 9d6f6238bc
commit 5f0d365c82
3 changed files with 18 additions and 0 deletions

View File

@ -24,6 +24,9 @@ module VagrantPlugins
@nested = config.nested @nested = config.nested
@memory_size = config.memory*1024 @memory_size = config.memory*1024
@domain_volume_cache = config.volume_cache @domain_volume_cache = config.volume_cache
@kernel = config.kernel
@cmd_line = config.cmd_line
@initrd = config.initrd
# TODO get type from driver config option # TODO get type from driver config option
@domain_type = 'kvm' @domain_type = 'kvm'
@ -46,6 +49,9 @@ module VagrantPlugins
env[:ui].info(" -- Storage pool: #{env[:machine].provider_config.storage_pool_name}") env[:ui].info(" -- Storage pool: #{env[:machine].provider_config.storage_pool_name}")
env[:ui].info(" -- Image: #{@domain_volume_path}") env[:ui].info(" -- Image: #{@domain_volume_path}")
env[:ui].info(" -- Volume Cache: #{@domain_volume_cache}") env[:ui].info(" -- Volume Cache: #{@domain_volume_cache}")
env[:ui].info(" -- Kernel: #{@kernel}")
env[:ui].info(" -- Initrd: #{@initrd}")
env[:ui].info(" -- Command line : #{@cmd_line}")
# Create libvirt domain. # Create libvirt domain.
# Is there a way to tell fog to create new domain with already # Is there a way to tell fog to create new domain with already

View File

@ -35,6 +35,9 @@ module VagrantPlugins
attr_accessor :disk_bus attr_accessor :disk_bus
attr_accessor :nested attr_accessor :nested
attr_accessor :volume_cache attr_accessor :volume_cache
attr_accessor :kernel
attr_accessor :cmd_line
attr_accessor :initrd
def initialize def initialize
@driver = UNSET_VALUE @driver = UNSET_VALUE
@ -53,6 +56,9 @@ module VagrantPlugins
@disk_bus = UNSET_VALUE @disk_bus = UNSET_VALUE
@nested = UNSET_VALUE @nested = UNSET_VALUE
@volume_cache = UNSET_VALUE @volume_cache = UNSET_VALUE
@kernel = UNSET_VALUE
@initrd = UNSET_VALUE
@cmd_line = UNSET_VALUE
end end
def finalize! def finalize!
@ -72,6 +78,9 @@ module VagrantPlugins
@disk_bus = 'virtio' if @disk_bus == UNSET_VALUE @disk_bus = 'virtio' if @disk_bus == UNSET_VALUE
@nested = false if @nested == UNSET_VALUE @nested = false if @nested == UNSET_VALUE
@volume_cache = 'default' if @volume_cache == UNSET_VALUE @volume_cache = 'default' if @volume_cache == UNSET_VALUE
@kernel = nil if @kernel == UNSET_VALUE
@cmd_line = '' if @cmd_line == UNSET_VALUE
@initrd = '' if @initrd == UNSET_VALUE
end end
def validate(machine) def validate(machine)

View File

@ -14,6 +14,9 @@
<os> <os>
<type arch='x86_64'>hvm</type> <type arch='x86_64'>hvm</type>
<boot dev='hd'/> <boot dev='hd'/>
<kernel><%= @kernel %></kernel>
<initrd><%= @initrd %></initrd>
<cmdline><%= @cmd_line %></cmdline>
</os> </os>
<features> <features>
<acpi/> <acpi/>