From 23d0a5b012c2e0a316e74e7621c5131037469553 Mon Sep 17 00:00:00 2001 From: Brad Wadsworth Date: Mon, 1 Jun 2015 10:19:06 -0500 Subject: [PATCH] changes to boot order option --- README.md | 1 + lib/vagrant-libvirt/action/create_domain.rb | 1 - lib/vagrant-libvirt/config.rb | 11 ++--------- lib/vagrant-libvirt/templates/domain.xml.erb | 5 ++++- 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 09a07fc..c90427a 100644 --- a/README.md +++ b/README.md @@ -170,6 +170,7 @@ end * `video_vram` - Used by some graphics card types to vary the amount of RAM dedicated to video. Defaults to 9216. * `machine` - Sets machine type. Equivalent to qemu `-machine`. Use `qemu-system-x86_64 -machine help` to get a list of supported machines. * `machine_arch` - Sets machine architecture. This helps libvirt to determine the correct emulator type. Possible values depend on your version of qemu. For possible values, see which emulator executable `qemu-system-*` your system provides. Common examples are `aarch64`, `alpha`, `arm`, `cris`, `i386`, `lm32`, `m68k`, `microblaze`, `microblazeel`, `mips`, `mips64`, `mips64el`, `mipsel`, `moxie`, `or32`, `ppc`, `ppc64`, `ppcemb`, `s390x`, `sh4`, `sh4eb`, `sparc`, `sparc64`, `tricore`, `unicore32`, `x86_64`, `xtensa`, `xtensaeb`. +* `boot` - Change the boot order and enables the boot menu. Defaults to 'hd' with boot menu disabled. Specific domain settings can be set for each domain separately in multi-VM diff --git a/lib/vagrant-libvirt/action/create_domain.rb b/lib/vagrant-libvirt/action/create_domain.rb index f0e1de4..8909971 100644 --- a/lib/vagrant-libvirt/action/create_domain.rb +++ b/lib/vagrant-libvirt/action/create_domain.rb @@ -157,7 +157,6 @@ module VagrantPlugins # Is there a way to tell fog to create new domain with already # existing volume? Use domain creation from template.. begin - print to_xml('domain') server = env[:libvirt_compute].servers.create( xml: to_xml('domain')) rescue Fog::Errors::Error => e diff --git a/lib/vagrant-libvirt/config.rb b/lib/vagrant-libvirt/config.rb index 58e80cc..bc446d6 100644 --- a/lib/vagrant-libvirt/config.rb +++ b/lib/vagrant-libvirt/config.rb @@ -121,15 +121,8 @@ module VagrantPlugins @cdroms = [] end - def _handle_boot_order(options={}) - boot_order = { - :dev => options[:dev] - } - @boot_order << boot_order # append - end - - def boot(options={}) - _handle_boot_order(options) + def boot(device) + @boot_order << device # append end def _get_device(disks) diff --git a/lib/vagrant-libvirt/templates/domain.xml.erb b/lib/vagrant-libvirt/templates/domain.xml.erb index 3685e30..fb9e443 100644 --- a/lib/vagrant-libvirt/templates/domain.xml.erb +++ b/lib/vagrant-libvirt/templates/domain.xml.erb @@ -28,8 +28,11 @@ <% end %> <% end %> <% @boot_order.each do |b| %> - + <% end %> + <% if @boot_order.count >= 1 %> + + <% end %> <%= @kernel %> <%= @initrd %> <%= @cmd_line %>