diff --git a/lib/vagrant-libvirt/action/create_domain.rb b/lib/vagrant-libvirt/action/create_domain.rb index 5f8f12c..ab0db55 100644 --- a/lib/vagrant-libvirt/action/create_domain.rb +++ b/lib/vagrant-libvirt/action/create_domain.rb @@ -49,6 +49,7 @@ module VagrantPlugins @cmd_line = config.cmd_line @emulator_path = config.emulator_path @initrd = config.initrd + @dtb = config.dtb @graphics_type = config.graphics_type @graphics_autoport = config.graphics_autoport @graphics_port = config.graphics_port diff --git a/lib/vagrant-libvirt/action/start_domain.rb b/lib/vagrant-libvirt/action/start_domain.rb index 30d8701..6aaa4e9 100644 --- a/lib/vagrant-libvirt/action/start_domain.rb +++ b/lib/vagrant-libvirt/action/start_domain.rb @@ -202,6 +202,20 @@ module VagrantPlugins video.attributes['vram'] = config.video_vram end + # dtb + if config.dtb + dtb = REXML::XPath.first(xml_descr,'/domain/os/dtb') + if dtb.nil? + dtb = REXML::Element.new('dtb', REXML::XPath.first(xml_descr,'/domain/os')) + dtb.text = config.dtb + else + if dtb.text != config.dtb + descr_changed = true + dtb.text = config.dtb + end + end + end + # Apply if descr_changed begin diff --git a/lib/vagrant-libvirt/config.rb b/lib/vagrant-libvirt/config.rb index 69c3656..21b95d7 100644 --- a/lib/vagrant-libvirt/config.rb +++ b/lib/vagrant-libvirt/config.rb @@ -73,6 +73,7 @@ module VagrantPlugins attr_accessor :kernel attr_accessor :cmd_line attr_accessor :initrd + attr_accessor :dtb attr_accessor :emulator_path attr_accessor :graphics_type attr_accessor :graphics_autoport @@ -148,6 +149,7 @@ module VagrantPlugins @volume_cache = UNSET_VALUE @kernel = UNSET_VALUE @initrd = UNSET_VALUE + @dtb = UNSET_VALUE @cmd_line = UNSET_VALUE @emulator_path = UNSET_VALUE @graphics_type = UNSET_VALUE @@ -433,6 +435,7 @@ module VagrantPlugins @kernel = nil if @kernel == UNSET_VALUE @cmd_line = '' if @cmd_line == UNSET_VALUE @initrd = '' if @initrd == UNSET_VALUE + @dtb = nil if @dtb == UNSET_VALUE @graphics_type = 'vnc' if @graphics_type == UNSET_VALUE @graphics_autoport = 'yes' if @graphics_port == UNSET_VALUE @graphics_autoport = 'no' if @graphics_port != UNSET_VALUE diff --git a/lib/vagrant-libvirt/templates/domain.xml.erb b/lib/vagrant-libvirt/templates/domain.xml.erb index 765aa39..bdae96c 100644 --- a/lib/vagrant-libvirt/templates/domain.xml.erb +++ b/lib/vagrant-libvirt/templates/domain.xml.erb @@ -42,6 +42,9 @@ <%= @kernel %> <%= @initrd %> <%= @cmd_line %> + <% if @dtb %> + <%= @dtb %> + <% end %>