Class: OsVm::MachineConfig::BridgeNetwork
- Inherits:
-
Network
- Object
- Network
- OsVm::MachineConfig::BridgeNetwork
show all
- Defined in:
- lib/osvm/machine_config.rb
Instance Attribute Summary collapse
Attributes inherited from Network
#index, #mac, #model, #type
Instance Method Summary
collapse
Methods inherited from Network
#default_opts, from_config, #resolve_mac_address, #resolve_model
Constructor Details
Returns a new instance of BridgeNetwork.
171
172
173
174
175
|
# File 'lib/osvm/machine_config.rb', line 171
def initialize(_i, cfg)
super
@link = @opts.fetch('link')
@helper = @opts['helper']&.to_s
end
|
Instance Attribute Details
#helper ⇒ String?
169
170
171
|
# File 'lib/osvm/machine_config.rb', line 169
def helper
@helper
end
|
#link ⇒ String
166
167
168
|
# File 'lib/osvm/machine_config.rb', line 166
def link
@link
end
|
Instance Method Details
#qemu_options ⇒ Object
177
178
179
180
181
182
183
184
185
|
# File 'lib/osvm/machine_config.rb', line 177
def qemu_options
netdev = "bridge,id=net#{index},br=#{link}"
netdev << ",helper=#{helper}" unless helper.nil? || helper.empty?
[
'-device', "#{model},netdev=net#{index},mac=#{mac}",
'-netdev', netdev
]
end
|