Merge pull request #558 from fred-a-kemp/feature/emulator_path

Make it possible to set the path to the device model emulator.
This commit is contained in:
Dmitry Vasilets 2016-03-10 08:25:43 +01:00
commit c458a5fc90
4 changed files with 8 additions and 0 deletions

View File

@ -210,6 +210,7 @@ end
* `machine_type` - 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`.
* `machine_virtual_size` - Sets the disk size in GB for the machine overriding the default specified in the box. Allows boxes to defined with a minimal size disk by default and to be grown to a larger size at creation time. Will ignore sizes smaller than the size specified by the box metadata. Note that currently there is no support for automatically resizing the filesystem to take advantage of the larger disk.
* `emulator_path` - Explicitly select which device model emulator to use by providing the path, e.g. `/usr/bin/qemu-system-x86_64`. This is especially useful on systems that fail to select it automatically based on `machine_arch` which then results in a capability error.
* `boot` - Change the boot order and enables the boot menu. Possible options are "hd", "network", "cdrom". Defaults to "hd" with boot menu disabled. When "network" is set without "hd", only all NICs will be tried; see below for more detail.
* `nic_adapter_count` - Defaults to '8'. Only use case for increasing this count is for VMs that virtualize switches such as Cumulus Linux. Max value for Cumulus Linux VMs is 33.
* `uuid` - Force a domain UUID. Defaults to autogenerated value by libvirt if not set.

View File

@ -45,6 +45,7 @@ module VagrantPlugins
@domain_volume_cache = config.volume_cache
@kernel = config.kernel
@cmd_line = config.cmd_line
@emulator_path = config.emulator_path
@initrd = config.initrd
@graphics_type = config.graphics_type
@graphics_autoport = config.graphics_autoport

View File

@ -71,6 +71,7 @@ module VagrantPlugins
attr_accessor :kernel
attr_accessor :cmd_line
attr_accessor :initrd
attr_accessor :emulator_path
attr_accessor :graphics_type
attr_accessor :graphics_autoport
attr_accessor :graphics_port
@ -144,6 +145,7 @@ module VagrantPlugins
@kernel = UNSET_VALUE
@initrd = UNSET_VALUE
@cmd_line = UNSET_VALUE
@emulator_path = UNSET_VALUE
@graphics_type = UNSET_VALUE
@graphics_autoport = UNSET_VALUE
@graphics_port = UNSET_VALUE
@ -442,6 +444,7 @@ module VagrantPlugins
@tpm_type = 'passthrough' if @tpm_type == UNSET_VALUE
@tpm_path = nil if @tpm_path == UNSET_VALUE
@nic_adapter_count = 8 if @nic_adapter_count == UNSET_VALUE
@emulator_path = nil if @emulator_path == UNSET_VALUE
# Boot order
@boot_order = [] if @boot_order == UNSET_VALUE

View File

@ -55,6 +55,9 @@
</features>
<clock offset='utc'/>
<devices>
<% if @emulator_path %>
<emulator><%= @emulator_path %></emulator>
<% end %>
<% if @domain_volume_path %>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2' cache='<%= @domain_volume_cache %>'/>