mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Some UEFI firmwares may want to use a non-volatile memory to store variables. This requires to specify loader and nvram to use UEFI boot in QEMU. Specifying loader and nvram at the same time will set loader to type 'pflash' instead of 'rom'. If loader is used without nvram option type will remain 'rom'. Further information can be found at libvirt documentation: https://libvirt.org/formatdomain.html#elementsOS
47 lines
813 B
Ruby
47 lines
813 B
Ruby
require 'ostruct'
|
|
require 'pathname'
|
|
|
|
class EnvironmentHelper
|
|
attr_writer :domain_name
|
|
|
|
attr_accessor :random_hostname, :name, :default_prefix
|
|
|
|
def [](value)
|
|
send(value.to_sym)
|
|
end
|
|
|
|
def cpus
|
|
4
|
|
end
|
|
|
|
def memory
|
|
1024
|
|
end
|
|
|
|
%w(cpus cpu_mode loader nvram boot_order machine_type disk_bus disk_device nested volume_cache kernel cmd_line initrd graphics_type graphics_autoport graphics_port graphics_ip graphics_passwd video_type video_vram keymap storage_pool_name disks cdroms driver).each do |name|
|
|
define_method(name.to_sym) do
|
|
nil
|
|
end
|
|
end
|
|
|
|
def machine
|
|
self
|
|
end
|
|
|
|
def provider_config
|
|
self
|
|
end
|
|
|
|
def root_path
|
|
Pathname.new('./spec/support/foo')
|
|
end
|
|
|
|
def domain_name
|
|
# noop
|
|
end
|
|
|
|
def libvirt_compute
|
|
OpenStruct.new(servers: [])
|
|
end
|
|
end
|