Merge pull request #374 from kampka/master

Add ability to specify the machine architecture via the domain arguments
This commit is contained in:
Dmitry Vasilets 2015-05-18 07:47:09 +02:00
commit b092a5444b
4 changed files with 18 additions and 5 deletions

View File

@ -169,6 +169,7 @@ end
* `keymap` - Set keymap for vm. default: en-us
* `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`.
Specific domain settings can be set for each domain separately in multi-VM

View File

@ -34,6 +34,7 @@ module VagrantPlugins
@cpus = config.cpus.to_i
@cpu_mode = config.cpu_mode
@machine_type = config.machine_type
@machine_arch = config.machine_arch
@disk_bus = config.disk_bus
@nested = config.nested
@memory_size = config.memory.to_i * 1024

View File

@ -56,6 +56,7 @@ module VagrantPlugins
attr_accessor :cpus
attr_accessor :cpu_mode
attr_accessor :machine_type
attr_accessor :machine_arch
attr_accessor :disk_bus
attr_accessor :nic_model_type
attr_accessor :nested
@ -95,6 +96,7 @@ module VagrantPlugins
@cpus = UNSET_VALUE
@cpu_mode = UNSET_VALUE
@machine_type = UNSET_VALUE
@machine_arch = UNSET_VALUE
@disk_bus = UNSET_VALUE
@nic_model_type = UNSET_VALUE
@nested = UNSET_VALUE
@ -277,6 +279,7 @@ module VagrantPlugins
@cpus = 1 if @cpus == UNSET_VALUE
@cpu_mode = 'host-model' if @cpu_mode == UNSET_VALUE
@machine_type = nil if @machine_type == UNSET_VALUE
@machine_arch = nil if @machine_arch == UNSET_VALUE
@disk_bus = 'virtio' if @disk_bus == UNSET_VALUE
@nic_model_type = 'virtio' if @nic_model_type == UNSET_VALUE
@nested = false if @nested == UNSET_VALUE

View File

@ -14,11 +14,19 @@
<% end %>
<os>
<% if @machine_type %>
<type machine='<%= @machine_type %>'>hvm</type>
<% else %>
<type>hvm</type>
<% end %>
<% if @machine_type %>
<% if @machine_arch %>
<type arch='<%= @machine_arch %>' machine='<%= @machine_type %>'>hvm</type>
<% else %>
<type machine='<%= @machine_type %>'>hvm</type>
<% end %>
<% else %>
<% if @machine_arch %>
<type arch='<%= @machine_arch %>'>hvm</type>
<% else %>
<type>hvm</type>
<% end %>
<% end %>
<boot dev='hd'/>
<kernel><%= @kernel %></kernel>
<initrd><%= @initrd %></initrd>