Class: VagrantPlugins::QEMU::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-qemu/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/vagrant-qemu/config.rb', line 21

def initialize
  @ssh_port = UNSET_VALUE
  @arch = UNSET_VALUE
  @machine = UNSET_VALUE
  @cpu = UNSET_VALUE
  @smp = UNSET_VALUE
  @memory = UNSET_VALUE
  @net_device = UNSET_VALUE
  @image_path = UNSET_VALUE
  @qemu_dir = UNSET_VALUE
  @extra_qemu_args = UNSET_VALUE
  @extra_netdev_args = UNSET_VALUE
  @control_port = UNSET_VALUE
  @debug_port = UNSET_VALUE
  @no_daemonize = UNSET_VALUE
end

Instance Attribute Details

#archObject

Returns the value of attribute arch.



7
8
9
# File 'lib/vagrant-qemu/config.rb', line 7

def arch
  @arch
end

#control_portObject

Returns the value of attribute control_port.



17
18
19
# File 'lib/vagrant-qemu/config.rb', line 17

def control_port
  @control_port
end

#cpuObject

Returns the value of attribute cpu.



9
10
11
# File 'lib/vagrant-qemu/config.rb', line 9

def cpu
  @cpu
end

#debug_portObject

Returns the value of attribute debug_port.



18
19
20
# File 'lib/vagrant-qemu/config.rb', line 18

def debug_port
  @debug_port
end

#extra_netdev_argsObject

Returns the value of attribute extra_netdev_args.



16
17
18
# File 'lib/vagrant-qemu/config.rb', line 16

def extra_netdev_args
  @extra_netdev_args
end

#extra_qemu_argsObject

Returns the value of attribute extra_qemu_args.



15
16
17
# File 'lib/vagrant-qemu/config.rb', line 15

def extra_qemu_args
  @extra_qemu_args
end

#image_pathObject

Returns the value of attribute image_path.



13
14
15
# File 'lib/vagrant-qemu/config.rb', line 13

def image_path
  @image_path
end

#machineObject

Returns the value of attribute machine.



8
9
10
# File 'lib/vagrant-qemu/config.rb', line 8

def machine
  @machine
end

#memoryObject

Returns the value of attribute memory.



11
12
13
# File 'lib/vagrant-qemu/config.rb', line 11

def memory
  @memory
end

#net_deviceObject

Returns the value of attribute net_device.



12
13
14
# File 'lib/vagrant-qemu/config.rb', line 12

def net_device
  @net_device
end

#no_daemonizeObject

Returns the value of attribute no_daemonize.



19
20
21
# File 'lib/vagrant-qemu/config.rb', line 19

def no_daemonize
  @no_daemonize
end

#qemu_dirObject

Returns the value of attribute qemu_dir.



14
15
16
# File 'lib/vagrant-qemu/config.rb', line 14

def qemu_dir
  @qemu_dir
end

#smpObject

Returns the value of attribute smp.



10
11
12
# File 'lib/vagrant-qemu/config.rb', line 10

def smp
  @smp
end

#ssh_portObject

Returns the value of attribute ssh_port.



6
7
8
# File 'lib/vagrant-qemu/config.rb', line 6

def ssh_port
  @ssh_port
end

Instance Method Details

#finalize!Object



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/vagrant-qemu/config.rb', line 47

def finalize!
  @ssh_port = 50022 if @ssh_port == UNSET_VALUE
  @arch = "aarch64" if @arch == UNSET_VALUE
  @machine = "virt,accel=hvf,highmem=on" if @machine == UNSET_VALUE
  @cpu = "host" if @cpu == UNSET_VALUE
  @smp = "2" if @smp == UNSET_VALUE
  @memory = "4G" if @memory == UNSET_VALUE
  @net_device = "virtio-net-device" if @net_device == UNSET_VALUE
  @image_path = nil if @image_path == UNSET_VALUE
  @qemu_dir = "/opt/homebrew/share/qemu" if @qemu_dir == UNSET_VALUE
  @extra_qemu_args = [] if @extra_qemu_args == UNSET_VALUE
  @extra_netdev_args = nil if @extra_netdev_args == UNSET_VALUE
  @control_port = nil if @control_port == UNSET_VALUE
  @debug_port = nil if @debug_port == UNSET_VALUE
  @no_daemonize = false if @no_daemonize == UNSET_VALUE
end

#merge(other) ⇒ Object


Internal methods.




42
43
44
45
# File 'lib/vagrant-qemu/config.rb', line 42

def merge(other)
  super.tap do |result|
  end
end

#validate(machine) ⇒ Object



64
65
66
67
68
# File 'lib/vagrant-qemu/config.rb', line 64

def validate(machine)
  # errors = _detected_errors
  errors = []
  { "QEMU Provider" => errors }
end